-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.prod.yaml
76 lines (75 loc) · 2.11 KB
/
docker-compose.prod.yaml
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
version: "3.8"
services:
symfony:
container_name: symfony
image: pbourdet/symfony-prod
build:
context: ./symfony/.
target: symfony_php
restart: unless-stopped
volumes:
- php_socket:/var/run/php
- php_logs:/srv/app/var/log
environment:
APP_ENV: prod
workers:
container_name: workers
image: pbourdet/workers-prod
build:
context: ./symfony/.
target: symfony_php
restart: unless-stopped
command: [ "bin/console", "messenger:consume", "async" ]
environment:
APP_ENV: prod
caddy:
container_name: caddy
image: pbourdet/caddy-prod
build:
context: ./symfony/.
target: symfony_caddy
depends_on:
- symfony
restart: unless-stopped
volumes:
- php_socket:/var/run/php
- caddy_data:/data
- caddy_config:/config
ports:
- "80:80/tcp"
- "443:443/tcp"
- "443:443/udp"
environment:
SERVER_NAME: ${SERVER_NAME}
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET}
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET}
MERCURE_EXTRA_DIRECTIVES: |-
cors_origins https://pierre-bourdet.dev
php-logs:
container_name: php-logs
image: busybox
depends_on:
- symfony
volumes:
- php_logs:/var/log
- ./symfony/docker/php-logs/print-logs.sh:/var/print-logs.sh
command: ["sh", "/var/print-logs.sh"]
environment:
APP_ENV: prod
postgres:
container_name: postgres
image: postgres:13-alpine
restart: always
ports:
- "5432:5432"
volumes:
- ./db_data:/var/lib/postgresql/data:rw
environment:
POSTGRES_DB: pbourdet
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_USER: root
volumes:
php_socket:
caddy_data:
caddy_config:
php_logs: