-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yaml
52 lines (47 loc) · 1.62 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
version: '3.7'
services:
db:
build:
context: ./modules/db
dockerfile: Dockerfile
container_name: db
command: postgres -c 'max_connections=1000'
restart: unless-stopped
network_mode: host
env_file:
- .env
volumes:
- ./modules/db/data/:/var/lib/postgresql/data
kamailio:
build:
context: ./modules/kamailio
dockerfile: Dockerfile
container_name: kamailio
restart: unless-stopped
network_mode: host
env_file:
- .env
volumes:
- ./modules/nginx/nginx-certbot/data/certbot/conf/:/etc/letsencrypt/
- ./modules/kamailio/kamailio.cfg:/etc/kamailio/kamailio.cfg
depends_on:
- db
nginx:
image: nginx:1.15-alpine
container_name: nginx
restart: unless-stopped
network_mode: host
volumes:
- ./modules/nginx/nginx-certbot/data/nginx:/etc/nginx/conf.d
- ./modules/nginx/nginx-certbot/data/certbot/conf:/etc/letsencrypt
- ./modules/nginx/nginx-certbot/data/certbot/www:/var/www/certbot
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
container_name: certbot
restart: unless-stopped
network_mode: host
volumes:
- ./modules/nginx/nginx-certbot/data/certbot/conf:/etc/letsencrypt
- ./modules/nginx/nginx-certbot/data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"