This repository has been archived by the owner on Sep 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.prod.yml
70 lines (69 loc) · 2.43 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
version: "3.2"
services:
# nginx-proxy:
# image: jwilder/nginx-proxy
# labels:
# com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
# restart: always
# ports:
# - 80:80
# - 443:443
# volumes:
# - /var/run/docker.sock:/tmp/docker.sock:ro
# - ${NGINX_FILES_PATH:-./nginx-data}/vhost.d:/etc/nginx/vhost.d
# - ${NGINX_FILES_PATH:-./nginx-data}/html:/usr/share/nginx/html
# - ${NGINX_FILES_PATH:-./nginx-data}/certs:/etc/nginx/certs:ro
# - ./nginx-proxy/conf.d/proxy.conf:/etc/nginx/conf.d/proxy.conf:ro
# letsencrypt-nginx-proxy-companion:
# image: jrcs/letsencrypt-nginx-proxy-companion
# restart: always
# depends_on:
# - nginx-proxy
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock:ro
# - ${NGINX_FILES_PATH:-./nginx-data}/vhost.d:/etc/nginx/vhost.d
# - ${NGINX_FILES_PATH:-./nginx-data}/html:/usr/share/nginx/html
# - ${NGINX_FILES_PATH:-./nginx-data}/certs:/etc/nginx/certs:rw
nginx:
image: nginx:1.15-alpine
restart: unless-stopped
volumes:
- ./config/nginx.conf:/etc/nginx/nginx.conf
- ./config/sites-enabled-template/server.conf.template:/etc/nginx/sites-enabled-template/server.conf.template
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
- ./public:/tmp/public
- ./run-nginx.sh:/run-nginx.sh
ports:
- "80:80"
- "443:443"
environment:
NGINX_SERVER_NAME:
NGINX_CERT_NAME:
BACKEND_VIRTUAL_HOST:
LIFF_VIRTUAL_HOST:
ADMIN_VIRTUAL_HOST:
GRAFANA_VIRTUAL_HOST:
depends_on:
- backend
- grafana
command: "/bin/sh -c 'sh /run-nginx.sh && while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
# command: "/bin/sh -c 'sh /run-nginx.sh && ls /etc/nginx/sites-enabled && cat /etc/nginx/sites-enabled/server.conf'"
certbot:
image: certbot/certbot
restart: unless-stopped
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;'"
backend:
build: ./backend
image: iceprojectbackend
restart: always
ports:
- 3000:3000
environment:
NODE_ENV: production
VIRTUAL_HOST: ${BACKEND_VIRTUAL_HOST}
LETSENCRYPT_HOST: ${BACKEND_VIRTUAL_HOST}
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}