-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.yml
executable file
·68 lines (63 loc) · 1.73 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
version: '3.7'
services:
ci-db:
image: postgres:11.6-alpine
volumes:
- pgdata:/var/lib/postgresql/data
environment:
- POSTGRES_DB=factlyin
- POSTGRES_USER=factlyin
- POSTGRES_PASSWORD=factlyin
ports:
- 5432:5432
networks:
- ci-net
ci-app:
build:
context: .
command: /bin/sh -c "python check_db.py --service-name ci-db --ip ci-db --port 5432 && python /usr/src/app/manage.py makemigrations && python /usr/src/app/manage.py migrate && bash ./db_install.sh && python /usr/src/app/manage.py initadmin && python /usr/src/app/manage.py runserver 0.0.0.0:8000"
environment:
- DJANGO_SECRET_KEY=${DJANGO_SECRET_KEY}
- WAIT_HOSTS=postgres:5432
- ADMIN_USERNAME=${ADMIN_USERNAME}
- ADMIN_EMAIL=${ADMIN_EMAIL}
- ADMIN_PASSWORD=${ADMIN_PASSWORD}
working_dir: /usr/src/app
volumes:
- .:/usr/src/app
ports:
- 8000
networks:
- ci-net
depends_on:
- ci-db
nginx:
image: nginx:1.19.0-alpine
ports:
- 80:80
- 443:443
volumes:
- ./nginx:/etc/nginx/conf.d
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
restart: unless-stopped
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
depends_on:
- ci-app
networks:
- ci-net
certbot:
image: certbot/certbot
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
restart: unless-stopped
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
depends_on:
- ci-app
networks:
- ci-net
volumes:
pgdata:
networks:
ci-net: