-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
89 lines (83 loc) · 1.91 KB
/
docker-compose.yml
File metadata and controls
89 lines (83 loc) · 1.91 KB
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
version: '3.8'
services:
db:
image: postgres:12
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: bitcamp
POSTGRES_USER: user
POSTGRES_PASSWORD: password
healthcheck:
test: ["CMD-SHELL", "pg_isready -d bitcamp -U user"]
interval: 5s
timeout: 5s
retries: 5
networks:
- backend
web:
build: .
command: >
sh -c "python3 manage.py migrate &&
python3 manage.py collectstatic --noinput &&
gunicorn bitcamp.wsgi:application --bind 0.0.0.0:8000"
volumes:
- .:/code
- web_media:/code/media
- web_static:/code/static
environment:
- SECRET_KEY=BitCamp-სწავლა-და-ბრძოლა-1024
- DEBUG=0
- DISCORD_BOT_TOKEN=<bot_token>
- DB_NAME=bitcamp
- DB_USER=user
- DB_PASS=password
- DB_HOST=db
- DB_PORT=5432
depends_on:
db:
condition: service_healthy
links:
- db
networks:
- backend
nginx:
image: nginx:alpine
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
- web_media:/code/media
- web_static:/code/static
- certbot-etc:/etc/letsencrypt
ports:
- "80:80"
- "443:443"
depends_on:
- web
networks:
- backend
certbot:
image: certbot/certbot
volumes:
- certbot-etc:/etc/letsencrypt
- web_static:/code/static
depends_on:
- nginx
command: certonly --webroot --webroot-path=/code/static --email info@bitcamp.ge --agree-tos --no-eff-email --force-renewal -d platform.bitcamp.ge -d platform.bitcamp.ge
networks:
backend:
driver: bridge
volumes:
postgres_data:
web_media:
driver: local
driver_opts:
type: bind
device: ./media
o: bind
web_static:
driver: local
driver_opts:
type: none
o: bind
device: ./static
certbot-etc: