-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
205 lines (192 loc) · 5.27 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
version: '3.7'
volumes:
db:
networks:
default:
driver: bridge
services:
# Reverse Proxy
traefik:
image: "traefik:${TRAEFIK_VERSION}"
container_name: "${APP_NAME}-${PROXY_SUBDOMAIN}"
command:
- --log.level=DEBUG
- --log.filePath=/var/log/error.log
- --accessLog.filePath=/var/log/access.log
- --providers.docker=true
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --entrypoints.web.http.redirections.entrypoint.to=websecure
- --entryPoints.web.http.redirections.entrypoint.scheme=https
- --api.dashboard=true
- --api.insecure=true
- --entryPoints.http.http.redirections.entryPoint.to=https
- --providers.file.filename=/etc/traefik/dynamic.yml
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./config/proxy/dynamic.yml:/etc/traefik/dynamic.yml:ro
- ./config/certs/apiopenstudio.local.pem:/etc/certs/apiopenstudio.pem:ro
- ./config/certs/apiopenstudio.local-key.pem:/etc/certs/apiopenstudio-key.pem:ro
- ./logs/traefik:/var/log:rw
networks:
- default
# Node Admin
admin:
container_name: "${APP_NAME}-${ADMIN_SUBDOMAIN}"
build:
context: .
dockerfile: "config/docker/Dockerfile-node"
labels:
- traefik.enable=true
- traefik.docker.network=apiopenstudio_docker_dev_default
- traefik.http.routers.admin.rule=Host(`${ADMIN_SUBDOMAIN}.${DOMAIN}`)
- traefik.http.routers.admin.tls=true
ports:
- "8081:8081"
volumes:
- ${ADMIN_CODEBASE}:/app:rw
networks:
- default
# Styleguidist
styleguide:
container_name: "${APP_NAME}-${STYLEGUIDE_SUBDOMAIN}"
build:
context: .
dockerfile: "config/docker/Dockerfile-node"
labels:
- traefik.enable=true
- traefik.docker.network=apiopenstudio_docker_dev_default
- traefik.http.routers.styleguide.rule=Host(`${STYLEGUIDE_SUBDOMAIN}.${DOMAIN}`)
- traefik.http.routers.styleguide.tls=true
ports:
- "6006:6006"
# - "5173:5173"
volumes:
- ${ADMIN_CODEBASE}:/app:rw
networks:
- default
# NGINX API server
api:
image: nginx:stable
container_name: "${APP_NAME}-${API_SUBDOMAIN}"
ports:
- "8082:80"
volumes:
- ./config/nginx/api.conf:/etc/nginx/conf.d/default.conf:ro
- ${API_CODEBASE}:/var/www/html:rw
- ./logs/nginx/:/var/log/nginx/:rw
depends_on:
- php
labels:
- traefik.enable=true
- traefik.docker.network=apiopenstudio_docker_dev_default
- traefik.http.routers.api.rule=Host(`${API_SUBDOMAIN}.${DOMAIN}`)
- traefik.http.routers.api.tls=true
networks:
- default
# Install composer requires
composer:
# image: composer:2.1.11 # Use for PHP 8.0
# image: composer:2.4.3 # Use for PHP 8.1
image: composer:latest # Use for PHP 8.2
container_name: "${APP_NAME}-composer"
ports:
- "9002:9000"
volumes:
- ${API_CODEBASE}:/app:rw
command: bash -c "composer install"
networks:
- default
# Database
db:
image: mariadb:latest
container_name: "${APP_NAME}-db"
ports:
- "3306:3306"
volumes:
- db:/var/lib/mysql:rw
env_file:
.env
restart: always
labels:
- traefik.enable=false
networks:
- default
# Generic PHP
php:
container_name: "${APP_NAME}-php"
build:
context: .
dockerfile: "config/docker/Dockerfile-${PHP_VERSION}"
args:
- WITH_MEMCACHED=${WITH_MEMCACHED}
- WITH_REDIS=${WITH_REDIS}
links:
- db:mysql
env_file:
.env
restart: always
labels:
- traefik.enable=false
ports:
- "9001:9000"
depends_on:
- db
volumes:
- ${API_CODEBASE}:/var/www/html:rw
- ./logs/apiopenstudio/:/var/log/apiopenstudio/:rw
networks:
- default
# # Uncomment this to enable the PHPDoc site.
# # PhpDoc container.
# phpdocumentor:
# image: phpdoc/phpdoc:latest
# platform: linux/amd64
# container_name: "${APP_NAME}-phpdocumentor"
# volumes:
# - ${API_CODEBASE}:/data:rw
# command:
# "run -d ./ -t ./public/phpdoc/ --title='PHPDoc'"
# networks:
# - default
#
# # NGINX PHPDoc server.
# phpdoc:
# image: nginx:stable
# container_name: "${APP_NAME}-${PHPDOC_SUBDOMAIN}"
# ports:
# - "8083:80"
# volumes:
# - ${API_CODEBASE}/public/phpdoc:/var/www/html:ro
# - ./config/nginx/phpdoc.conf:/etc/nginx/conf.d/default.conf:ro
# labels:
# - traefik.enable=true
# - traefik.docker.network=apiopenstudio_docker_dev_default
# - traefik.http.routers.nginx.rule=Host(`${PHPDOC_SUBDOMAIN}.${DOMAIN}`)
# - traefik.http.routers.nginx.tls=true
# networks:
# - default
# # Uncomment this to create a Redis server for caching.
# # Redis cache server
# redis:
# image: redis/redis-stack:latest
# container_name: "${APP_NAME}-redis"
# ports:
# - "6379:6379"
# - "8001:8001"
# networks:
# - default
# # Uncomment this to create a Memcached server for caching.
# # Memcached server
# memcached:
# image: memcached:latest
# container_name: "${APP_NAME}-memcached"
# ports:
# - "11211:11211"
# command: -m 64
# networks:
# - default