-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yml
82 lines (76 loc) · 1.71 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
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
# Service setup for production
version: '2'
volumes:
postgres_data: {}
assets_bower: {}
assets_node: {}
services:
postgres:
restart: always
image: postgres:9.6
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=tfk
backend:
restart: always
build:
context: .
dockerfile: ./compose/django/Dockerfile
command: /gunicorn.sh
depends_on:
- postgres
links:
- postgres:db
environment:
- USE_DOCKER=yes
- DATABASE_WAIT=yes
- DJANGO_SETTINGS_MODULE=settings.prod
env_file:
- .env
- .env-prod
# Container used for generating static content and extrating them
backend-assets:
build:
context: .
dockerfile: ./compose/django/Dockerfile
command: /bin/true
volumes:
- ./backend/staticfiles:/app/staticfiles
environment:
- USE_DOCKER=yes
- DATABASE_SKIP=yes
- DJANGO_SETTINGS_MODULE=settings.prod
env_file:
- .env
rproxy:
restart: always
build:
context: ./compose/nginx
dockerfile: ./Dockerfile
depends_on:
- backend
env_file:
- .env
links:
- backend
volumes:
- ./frontend/dist:/usr/share/nginx/html
- ./backend/staticfiles:/usr/share/nginx/backend
ports:
- "${WEB_PORT}:80"
# Container used for generating static assets, does not run anything
frontend:
restart: always
build: ./compose/assets
volumes:
- ./frontend:/app
- assets_bower:/app/bower_components
- assets_node:/app/node_modules
tmpfs:
- /app/tmp
env_file:
- .env
command: /bin/true