-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
202 lines (192 loc) · 5.88 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
version: "3.4"
services:
php:
build:
context: .
target: app_php
args:
SYMFONY_VERSION: ${SYMFONY_VERSION:-}
STABILITY: ${STABILITY:-stable}
container_name: pokemon-php
hostname: pokemon-php
restart: unless-stopped
volumes:
- php_socket:/var/run/php
ports:
# TCP
- target: 9000
published: ${HTTP_PORT:-9000}
protocol: tcp
# TCP
- target: 9009
published: ${HTTPS_PORT:-9009}
protocol: tcp
healthcheck:
interval: 10s
timeout: 3s
retries: 3
start_period: 30s
environment:
# Run "composer require symfony/orm-pack" to install and configure Doctrine ORM
DATABASE_URL: "mysql://projectuser:ChangeMe123@pokemon-mysql:3306/projectdb"
# DATABASE_URL: "mysql://projectuser:[email protected]:3306/projectdb"
# Run "composer require symfony/mercure-bundle" to install and configure the Mercure integration
# MERCURE_URL: ${CADDY_MERCURE_URL:-http://caddy/.well-known/mercure}
# MERCURE_URL: ${CADDY_MERCURE_URL:-http://localhost/.well-known/mercure}
# MERCURE_PUBLIC_URL: https://${SERVER_NAME:-localhost}/.well-known/mercure
# MERCURE_JWT_SECRET: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: projectdb
MYSQL_USER: projectuser
MYSQL_PASSWORD: ChangeMe123
# SYMFONY_ENV: ${SYMFONY_ENV}
# XDEBUG: ${XDEBUG}
# XDEBUG_HOST: ${XDEBUG_HOST}
# PHP_TIMEZONE: ${PHP_TIMEZONE}
# PHP_DISPLAY_ERRORS: ${PHP_DISPLAY_ERRORS}
networks:
- pokemonnet
webserver:
image: nginx:alpine
build:
context: ./docker/nginx
container_name: pokemon-nginx
hostname: pokemon-nginx
working_dir: /srv/app
environment:
SYMFONY_ENV: ${SYMFONY_ENV}
# SERVER_NAME: ${SERVER_NAME:-localhost}
SERVER_NAME: ${SERVER_NAME:-pokemon-symfony-docker.loc}
# SERVER_NAME: ${SERVER_NAME:-localhost, -pokemon-symfony-docker.loc}
HOST_DOMAIN: ${HOST_DOMAIN:-pokemon-symfony-docker.loc}
# HOST_DOMAIN: ${HOST_DOMAIN:-localhost, -pokemon-symfony-docker.loc}
# HOST_DOMAIN: localhost
# MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
# MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
restart: unless-stopped
volumes:
- php_socket:/var/run/php
- .:/srv/app:cached
- ./docker/nginx/nginx_dev.conf:/etc/nginx/conf.d/default.conf
# - ./docker/nginx/nginx_prod.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/sites/:/etc/nginx/sites-available
# - ./logs:/var/log
ports:
- "80:80"
# HTTPS
# - target: 443
# published: ${HTTPS_PORT:-443}
# protocol: tcp
# # HTTP/3
# - target: 443
# published: ${HTTP3_PORT:-443}
# protocol: udp
- "2019:2019"
depends_on:
- php
links:
- php
networks:
- pokemonnet
# caddy:
# build:
# context: .
# target: app_caddy
# container_name: pokemon-cady-webserver
# hostname: pokemon-cady-webserver
# depends_on:
# - php
# environment:
## SERVER_NAME: ${SERVER_NAME:-localhost}
# SERVER_NAME: ${SERVER_NAME:-pokemon-symfony-docker.loc}
## SERVER_NAME: ${SERVER_NAME:-localhost, -pokemon-symfony-docker.loc}
# HOST_DOMAIN: ${HOST_DOMAIN:-pokemon-symfony-docker.loc}
## HOST_DOMAIN: ${HOST_DOMAIN:-localhost, -pokemon-symfony-docker.loc}
## HOST_DOMAIN: localhost
# MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
# MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!}
# restart: unless-stopped
# security_opt:
# - no-new-privileges:true
# volumes:
# - php_socket:/var/run/php
# - caddy_data:/data
# - caddy_config:/docker/caddy/Caddyfile
# - ./docker/caddy/certificates:/data/caddy/certificates/local
# - ./docker/caddy/authorities:/data/caddy/pki/authorities/local
## - ./etc-caddy:/etc/caddy
# ports:
# # HTTP
# - target: 80
# published: ${HTTP_PORT:-80}
# protocol: tcp
# # HTTPS
# - target: 443
# published: ${HTTPS_PORT:-443}
# protocol: tcp
# # HTTP/3
# - target: 443
# published: ${HTTP3_PORT:-443}
# protocol: udp
# - "2019:2019"
## - target: 2019
## published: ${HTTP_PORT:-2019}
## protocol: tcp
# networks:
# - pokemonnet
database:
image: 'mysql:8.0'
container_name: pokemon-mysql
hostname: pokemon-mysql
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: projectdb
MYSQL_USER: projectuser
MYSQL_PASSWORD: ChangeMe123
ports:
- "3306:3306"
- "33060:33060"
- "5432:5432"
restart: unless-stopped
volumes:
- ./mysql-data:/var/lib/mysql
# - ./mysql-data:/var/lib/mysql:cached
networks:
- pokemonnet
redis:
image: redis:alpine
container_name: pokemon-redis
hostname: pokemon-redis
ports:
- "6379:6379"
restart: unless-stopped
networks:
- pokemonnet
mailer:
image: schickling/mailcatcher
container_name: pokemon-mailer
hostname: pokemon-mailer
ports:
- "1025:1025"
- "1080:1080"
networks:
- pokemonnet
# rabbitmq:
# image: rabbitmq:3.7-management
# container_name: pokemon-rabbitmq
# hostname: pokemon-rabbitmq
# ports:
# - "5672:5672"
# - "15672:15672"
volumes:
php_socket:
# caddy_data:
# caddy_config:
#Docker Networks
networks:
pokemonnet:
driver: bridge
# Mercure is installed as a Caddy module, prevent the Flex recipe from installing another service
###> symfony/mercure-bundle ###
###< symfony/mercure-bundle ###