forked from opensourcepos/opensourcepos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.nginx.yml
More file actions
38 lines (35 loc) · 1.23 KB
/
docker-compose.nginx.yml
File metadata and controls
38 lines (35 loc) · 1.23 KB
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
include:
- docker-compose.yaml
services:
nginx:
image: nginx:1.19-alpine
container_name: nginx
restart: always
depends_on:
- ospos
- certbot
volumes:
- ./docker/data/nginx/nginx.tmpl:/etc/nginx/nginx.tmpl:ro
- ./docker/data/nginx/error_log.log:/etc/nginx/error_log.log
- ./docker/data/certbot/conf:/etc/letsencrypt:ro
- ./docker/data/certbot/www:/var/www/certbot:ro
ports:
- "80:80"
- "443:443"
- "8000:8000"
networks:
- app_net
environment:
- WEB_DOMAIN=${OSPOS_DOMAIN_NAME}
- ESC=$$
command: "/bin/sh -c 'envsubst < /etc/nginx/nginx.tmpl > /etc/nginx/nginx.conf & while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
container_name: certbot
restart: always
volumes:
- ./docker/data/certbot/conf:/etc/letsencrypt
- ./docker/data/certbot/www:/var/www/certbot
networks:
- app_net
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"