-
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
84 lines (82 loc) · 2.02 KB
/
Copy pathdocker-compose.yml
File metadata and controls
84 lines (82 loc) · 2.02 KB
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
83
84
services:
db:
image: postgres:latest
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
env_file:
- .env
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:latest
command: redis-server
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
api:
build:
context: .
dockerfile: ./Dockerfile
volumes:
- ./api:/app/api
- ./media:/app/media
- api_staticfiles:/app/api/staticfiles
ports:
- "${API_PORT:-8030}:${API_PORT:-8030}"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
env_file:
- .env
environment:
- DB_HOST=db
- REDIS_HOST=redis
- DJANGO_SETTINGS_MODULE=virtual_bank.settings
- API_HOST=0.0.0.0
- API_PORT=${API_PORT:-8030}
- API_URL=http://${API_HOST:-api}:${API_PORT:-8030}
command: python manage.py runserver 0.0.0.0:${API_PORT:-8030}
client:
build:
context: .
dockerfile: ./Dockerfile.client
volumes:
- ./clients:/app/clients
- ./media:/app/media
- client_staticfiles:/app/clients/staticfiles
ports:
- "${CLIENT_PORT:-8040}:${CLIENT_PORT:-8040}"
depends_on:
- api
- db
- redis
env_file:
- .env
environment:
- DB_HOST=db
- REDIS_HOST=redis
- DJANGO_SETTINGS_MODULE=virtual_bank.settings
- CLIENT_HOST=0.0.0.0
- CLIENT_PORT=${CLIENT_PORT:-8040}
- CLIENT_URL=http://${CLIENT_HOST:-client}:${CLIENT_PORT:-8040}
- API_URL=http://api:${API_PORT:-8030}
command: python manage.py runserver 0.0.0.0:${CLIENT_PORT:-8040}
volumes:
postgres_data:
api_staticfiles:
client_staticfiles: