-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
67 lines (60 loc) · 1.5 KB
/
docker-compose.yaml
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
# Before starting first, to make nginx starts in HTTPS, you need to run init-letsencrypt.sh
version: "3"
services:
# Main node/express REST server
api:
container_name: api
restart: always
build:
context: ./api
dockerfile: ./api.dockerfile
volumes:
- ./api/data:/usr/api/data
# Video encoder
encoder:
container_name: encoder
restart: always
build:
context: ./api
dockerfile: ./encoder.dockerfile
volumes:
- ./api/data:/usr/api/data
depends_on:
- api
# Frontend React app, served by NGINX on port 80
app:
container_name: app
restart: always
build:
context: ./app
dockerfile: ./app.dockerfile
# End point of the server
nginx:
container_name: nginx
restart: always
image: nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx:/etc/nginx/conf.d
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
depends_on:
- api
- app
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
# Automate certificate renewal
certbot:
image: certbot/certbot
container_name: certbot
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
depends_on:
- nginx
# Renew the certificate every 12h
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
volumes:
certbot-etc:
certbot-var: