-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.dev.yml
78 lines (72 loc) · 1.8 KB
/
docker-compose.dev.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.7'
services:
backend:
build:
context: .
dockerfile: Dockerfile.dev
command: bash -c "pip install -r requirements.txt && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
env_file:
./.env
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/tracker/"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 10s
volumes:
- ./django-donation-tracker:/usr/src/app/django-donation-tracker
depends_on:
- db
tracker: # lie for nginx' benefit
build:
context: .
dockerfile: Dockerfile.dev
command: bash -c "cd django-donation-tracker && yarn && yarn start --port 8000 --host 0.0.0.0"
env_file:
./.env
environment:
TRACKER_HOST: http://backend:8000
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/tracker"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 10s
volumes:
- ./django-donation-tracker:/usr/src/app/django-donation-tracker
ports:
- "8001:8000"
depends_on:
- backend
webserver:
image: nginx:alpine
container_name: webserver
restart: unless-stopped
tty: true
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
ports:
- "8000:80"
- "443:443"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/tracker/"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
depends_on:
- tracker
db:
image: postgres:12-alpine
volumes:
- db_data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=tracker
- POSTGRES_PASSWORD=deadbeef
- POSTGRES_DB=donations
redis:
image: "redis:alpine"
volumes:
db_data: