-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdocker-compose.yml
78 lines (76 loc) · 1.92 KB
/
docker-compose.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
version: '3.4'
services:
db:
image: "${REGISTRY_NAME}postgres:10.1-alpine"
volumes:
- postgres_data:/var/lib/postgresql/data/
networks:
- "internal"
env_file:
- ./.env
restart: always
web:
build:
context: ./app
dockerfile: Dockerfile
args:
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DEPLOYMENT_MODE
working_dir: /Yearbook
image: "${REGISTRY_NAME}devclubiitd/yearbook:0.1"
command: gunicorn --workers=6 --threads=4 --worker-class=gthread yearbook.wsgi:application --bind 0.0.0.0:8000
volumes:
- yearbook_media:/Yearbook/media/
- yearbook_static:/Yearbook/static/
expose:
- 8000
networks:
- "internal"
env_file:
- ./.env
environment:
- DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db/${POSTGRES_DB}
- POSTGRES_HOST_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db
- VIRTUAL_HOST=${VIRTUAL_HOST}
depends_on:
- db
links:
- db:db
restart: always
nginx:
image: "${REGISTRY_NAME}devclubiitd/yearbook-nginx:0.1"
build: ./nginx
volumes:
- yearbook_media:/Yearbook/media/
- yearbook_static:/Yearbook/static/
ports:
- ${DEPLOY_PORT}:80
depends_on:
- web
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${DEPLOY_PORT}"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- "reverseproxy"
- "internal"
env_file:
- ./.env
environment:
- DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db/${POSTGRES_DB}
- POSTGRES_HOST_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db
- VIRTUAL_HOST=${VIRTUAL_HOST}
restart: always
volumes:
postgres_data:
yearbook_media:
yearbook_static:
networks:
reverseproxy:
external:
name: "reverseproxy"
internal: