-
Notifications
You must be signed in to change notification settings - Fork 32
/
docker-compose-prod.yml
47 lines (46 loc) · 1.48 KB
/
docker-compose-prod.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
version: '3'
services:
db:
container_name: analytics_db_prod
image: postgres
ports:
- "6435:5432"
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- ./dbs/postgres-data-prod:/var/lib/postgresql
backend:
container_name: analytics_backend_prod
build:
context: ./application
dockerfile: Dockerfile-prod
command: bash -c "sleep 3 && pip uninstall -y python3-openid &&
pip uninstall -y social-auth-app-django &&
pip install django-rest-framework-social-oauth2 &&
python manage.py makemigrations --noinput &&
python manage.py migrate --noinput &&
python manage.py collectstatic --noinput &&
gunicorn analytics_project.wsgi -b 0.0.0.0:8001 --workers 2";
volumes:
- ./application:/application
expose:
- 8000
restart: always
links:
- db
nginx:
image: nginx:latest
container_name: analytics_nginx_prod
ports:
- "80:80"
volumes:
- ./application/media:/backend/src/media
- ./application/static-backend:/backend/src/static-backend
- ./frontend/build:/frontend/src
- ./nginx:/etc/nginx/conf.d
depends_on:
- backend
volumes:
postgres_data: