-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yaml
46 lines (45 loc) · 1.15 KB
/
docker-compose.prod.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
version: "3.3"
services:
djangoinst:
build: .
command: sh -c "python manage.py collectstatic --noinput && python manage.py migrate &&
gunicorn djangoInstagram.wsgi:application --bind 0.0.0.0:8000 "
restart: always
volumes:
- django-static:/usr/src/service/staticfiles
- django-media:/usr/src/service/mediafiles
env_file:
- ./.env.prod
depends_on:
- db
db:
image: postgres:13-alpine
container_name: djangoinst_postgresql
volumes:
- postgres_data:/var/lib/postgresql/data/
expose:
- 5432
environment:
- POSTGRES_USER=inst_client
- POSTGRES_PASSWORD=123
- POSTGRES_DB=inst
nginx:
restart: unless-stopped
image: staticfloat/nginx-certbot
ports:
- "80:80"
- "443:443"
volumes:
- django-static:/usr/src/service/staticfiles
- django-media:/usr/src/service/mediafiles
- letsencrypt:/etc/letsencrypt
- ./conf.d:/etc/nginx/user.conf.d:ro
environment:
links:
- djangoinst:djangoinst
volumes:
postgres_data:
django-static:
django-media:
letsencrypt: