-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-prod.yml
executable file
·208 lines (196 loc) · 4.7 KB
/
docker-compose-prod.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
206
207
208
networks:
calendize-network:
driver: bridge
volumes:
postgres_data:
driver: local
redis_data:
driver: local
certbot_letsencrypt_data:
driver: local
certbot_www_data:
driver: local
public:
driver: local
bootstrap_cache:
driver: local
bootstrap_ssr:
driver: local
logs:
driver: local
services:
certbot:
image: certbot/certbot:latest
restart: no
container_name: certbot
volumes:
- certbot_letsencrypt_data:/etc/letsencrypt
- certbot_www_data:/tmp/letsencrypt
command:
- "certonly"
- "--webroot"
- "--agree-tos"
- "--renew-by-default"
- "--preferred-challenges"
- "http-01"
- "--server"
- "https://acme-v02.api.letsencrypt.org/directory"
- "--text"
- "--email=${ADMIN_EMAIL}"
- "-w"
- "/tmp/letsencrypt"
- "-d"
- "${REVERB_HOST}"
depends_on:
nginx:
condition: service_started
nginx:
image: hrsa/calendize-nginx:first
build:
context: .
dockerfile: ./docker/nginx.dockerfile
target: prod
args:
- UID=${UID:-1001}
- GID=${GID:-1001}
- USER=${USER:-anton}
restart: unless-stopped
container_name: nginx
volumes:
- certbot_letsencrypt_data:/etc/letsencrypt
- certbot_www_data:/var/www/certbot
- public:/var/www/public
- bootstrap_cache:/var/www/bootstrap/cache
- bootstrap_ssr:/var/www/bootstrap/ssr
- logs:/var/www/storage/logs
- ./.env:/var/www/.env
ports:
- "80:80"
- "443:443"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
php:
condition: service_started
queue:
condition: service_started
cron:
condition: service_started
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- calendize-network
php:
image: hrsa/calendize-php:first
build:
context: .
dockerfile: ./docker/php-prod.dockerfile
target: php
args:
- UID=${UID:-1001}
- GID=${GID:-1001}
- USER=${USER:-anton}
container_name: php
volumes:
- ./.env:/var/www/.env
- public:/var/www/public
- bootstrap_cache:/var/www/bootstrap/cache
- bootstrap_ssr:/var/www/bootstrap/ssr
- certbot_letsencrypt_data:/etc/letsencrypt
- logs:/var/www/storage/logs
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "127.0.0.1:9000:9000"
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- calendize-network
queue:
image: hrsa/calendize-queue:first
build:
context: .
dockerfile: ./docker/php-prod.dockerfile
target: queue
args:
- UID=${UID:-1001}
- GID=${GID:-1001}
- USER=${USER:-anton}
container_name: queue
volumes:
- ./.env:/var/www/.env
- public:/var/www/public
- bootstrap_cache:/var/www/bootstrap/cache
- bootstrap_ssr:/var/www/bootstrap/ssr
- certbot_letsencrypt_data:/etc/letsencrypt
- logs:/var/www/storage/logs
ports:
- "127.0.0.1:8080:8080"
healthcheck:
test: [ "CMD", "healthcheck-horizon", "&&", "healthcheck-reverb" ]
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
networks:
- calendize-network
cron:
image: hrsa/calendize-cron:first
build:
context: .
dockerfile: ./docker/php-prod.dockerfile
target: cron
args:
- UID=${UID:-1001}
- GID=${GID:-1001}
- USER=${USER:-anton}
container_name: cron
volumes:
- ./.env:/var/www/.env
- logs:/var/www/storage/logs
healthcheck:
test: [ "CMD", "healthcheck-schedule" ]
depends_on:
db:
condition: service_healthy
php:
condition: service_started
networks:
- calendize-network
db:
image: postgres:17.2
container_name: db
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${DB_DATABASE}
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
ports:
- "127.0.0.1:5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${DB_USERNAME} -d ${DB_DATABASE}" ]
interval: 5s
timeout: 30s
retries: 6
networks:
- calendize-network
redis:
image: redis:latest
container_name: redis
volumes:
- redis_data:/data
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
timeout: 30s
retries: 6
networks:
- calendize-network