-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yml
44 lines (42 loc) · 1.15 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
version: "3.7"
services:
mongo:
environment:
- MONGO_INITDB_ROOT_USERNAME
- MONGO_INITDB_ROOT_PASSWORD
redis:
environment:
- REDIS_PASSWORD
command: sh -c 'exec redis-server --requirepass "$REDIS_PASSWORD"'
graphql:
env_file:
- .env
- ./server/.env
command: pm2-runtime process.yml
nginx:
image: nginx:1.17-alpine
container_name: nginx
restart: always
volumes:
- ./nginx:/etc/nginx/conf.d
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
ports:
- 80:80
- 443:443
environment:
- DOMAIN
depends_on:
- graphql
- client
command: >
/bin/sh -c "envsubst '$$DOMAIN' < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && \
while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g 'daemon off;'"
certbot:
image: certbot/certbot
container_name: certbot
restart: always
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"