-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
97 lines (91 loc) · 2.57 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
services:
mysql:
image: mysql:latest
container_name: mysql_treeqlqs-${CONTAINERS_NAME_SUFFIX}
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- ./mysql:/var/lib/mysql
ports:
- "3306:3306"
networks:
- php-api-network
php:
build:
context: .
dockerfile: Dockerfile
container_name: php-fpm_treeqlqs-${CONTAINERS_NAME_SUFFIX}
volumes:
- ./php:/var/www/html
environment:
PHP_CRUD_API_PORT: 3306 #${PORT}
PHP_CRUD_API_ADDRESS: mysql_treeqlqs-${CONTAINERS_NAME_SUFFIX} #${SERVER_NAME}
PHP_CRUD_API_DATABASE: ${MYSQL_DATABASE}
PHP_CRUD_API_USERNAME: ${MYSQL_USER}
PHP_CRUD_API_PASSWORD: ${MYSQL_PASSWORD}
PHP_CRUD_API_DEBUG: ${PHP_CRUD_API_DEBUG}
depends_on:
- mysql
networks:
- php-api-network
web:
image: nginx:latest
container_name: nginx_treeqlqs-${CONTAINERS_NAME_SUFFIX}
restart: always
environment:
- SERVER_NAME=${SERVER_NAME}
- DB_ADMIN_PORT=${DB_ADMIN_PORT}
- CONTAINERS_NAME_SUFFIX=${CONTAINERS_NAME_SUFFIX}
volumes:
- ./nginx/default.conf.template:/etc/nginx/conf.d/default.conf.template
- ./php:/var/www/html
ports:
- "${PORT}:80"
command: /bin/bash -c "envsubst '$$SERVER_NAME $$DB_ADMIN_PORT $$CONTAINERS_NAME_SUFFIX' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
depends_on:
- php
networks:
- php-api-network
adminer:
container_name: dbadmin_treeqlqs-${CONTAINERS_NAME_SUFFIX}
image: adminer
restart: always
environment:
ADMINER_DEFAULT_SERVER: mysql_treeqlqs-${CONTAINERS_NAME_SUFFIX}
networks:
- php-api-network
depends_on:
- web
profiles:
- adminer
phpmyadmin:
container_name: dbadmin_treeqlqs-${CONTAINERS_NAME_SUFFIX}
image: phpmyadmin/phpmyadmin
restart: always
environment:
PMA_HOST: mysql_treeqlqs-${CONTAINERS_NAME_SUFFIX}
PMA_ABSOLUTE_URI: ${SERVER_NAME}dbadmin/
networks:
- php-api-network
depends_on:
- web
profiles:
- phpmyadmin
swagger:
container_name: swagger_treeqlqs-${CONTAINERS_NAME_SUFFIX}
image: swaggerapi/swagger-ui
restart: always
environment:
SWAGGER_JSON_URL: ${SERVER_NAME}openapi
DOC_EXPANSION: none
networks:
- php-api-network
depends_on:
- web
networks:
php-api-network:
driver: bridge