-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
93 lines (84 loc) · 2.12 KB
/
docker-compose.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Define the containers to have a functionnal backend API for the Clapback app
# 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: clapback-backend
restart: always
build: .
ports:
- "9000:9000"
depends_on:
- mongo
- rabbitmq
volumes:
- ./public:/usr/app/public
links:
- mongo
- rabbitmq
# Video processor (for encoding with RabbitMQ)
video-processor:
container_name: video-processor
restart: always
build:
context: .
dockerfile: ./video-processor/Dockerfile
volumes:
- ./public:/var/public
depends_on:
- api
- rabbitmq
links:
- mongo
- rabbitmq
# Mongo DB, mounted on 27017
mongo:
container_name: mongo
image: mongo
restart: always
ports:
- 27017:27017
volumes:
- ./data-node:/data/db
# 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
- ./public:/var/public
depends_on:
- api
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
rabbitmq:
image: rabbitmq:3-management-alpine
restart: always
container_name: rabbitmq
environment:
RABBITMQ_ERLANG_COOKIE: ${RABBITMQ_ERLANG_COOKIE}
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS}
ports:
- 5672:5672
- 15672:15672
# 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: