-
Notifications
You must be signed in to change notification settings - Fork 11
/
docker-compose-staging.yaml
70 lines (66 loc) · 1.65 KB
/
docker-compose-staging.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
68
69
70
services:
backend:
container_name: nest-backend
image: arkid15r/owasp-nest-backend:latest
command: >
bash -c "
poetry run python manage.py migrate &&
poetry run python manage.py collectstatic --noinput &&
poetry run gunicorn wsgi:application --bind 0.0.0.0:8000 &
poetry run python manage.py run_slack_bot;
wait
"
env_file: .env/backend
depends_on:
db:
condition: service_healthy
restart: unless-stopped
networks:
- nest_app_network
- nest_db_network
volumes:
- ./data:/home/owasp/data
certbot:
container_name: nest-certbot
image: certbot/certbot
volumes:
- ./letsencrypt:/etc/letsencrypt
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
entrypoint: /bin/sh -c 'trap exit TERM; while :; do certbot renew --webroot -w /var/www/certbot --quiet; sleep 12h & wait $${!}; done;'
db:
container_name: nest-db
image: postgres:16.4
env_file: .env/db
healthcheck:
test:
[
'CMD',
'pg_isready',
'-U',
'nest_user_staging',
'-d',
'nest_db_staging',
]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
- ./volumes/db:/var/lib/postgresql/data
networks:
- nest_db_network
nginx:
container_name: nest-nginx
image: nginx:latest
ports:
- '443:443'
volumes:
- ./letsencrypt:/etc/letsencrypt
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- backend
networks:
- nest_app_network
networks:
nest_app_network:
nest_db_network: