forked from roedoejet/wordweaver-pre-serverless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
46 lines (46 loc) · 1.47 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
version: '3.3'
services:
backend:
build:
args:
env: dev
context: ./src
dockerfile: Dockerfile
command: 'bash -c "wordweaver validate && wordweaver compress && /start-reload.sh"'
env_file:
- env-backend.env
environment:
- SERVER_HOST=http://backend
- SERVER_NAME=backend
expose:
- 8080
networks:
- web
volumes:
- ./src/wordweaver:/app/wordweaver
certbot:
image: certbot/certbot
volumes:
- ./volumes/ssl/certbot/conf:/etc/letsencrypt
- ./volumes/ssl/certbot/www:/var/www/certbot
- ./volumes/ssl/certbot/logs:/var/log/letsencrypt
networks:
- web
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
reverse:
command: /bin/bash -c "envsubst '$$SERVER_NAME' < /etc/nginx/conf.d/wordweaver.template > /etc/nginx/conf.d/default.conf && /bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
environment:
- SERVER_NAME=${DOMAIN}
restart: always
image: nginx:latest
networks:
- web
ports:
- 80:80
- 443:443
volumes:
- ./volumes/reverse/nginx/conf/wordweaver.template:/etc/nginx/conf.d/wordweaver.template
- ./volumes/ssl/certbot/conf:/etc/letsencrypt
- ./volumes/ssl/certbot/www:/var/www/certbot
networks:
web: