-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
86 lines (77 loc) · 1.56 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
79
80
81
82
83
84
85
version: '3.8'
services:
redis:
image: redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
command: redis-server --appendonly yes
container_name: redis
networks:
- database
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
timeout: 5s
retries: 5
postgres:
image: postgres:alpine
ports:
- "5432:5432"
container_name: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: bookvita
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- database
healthcheck:
test: [ "CMD", "pg_isready", "-U", "postgres" ]
interval: 5s
timeout: 5s
retries: 5
server:
build: ./server/
networks:
- database
- web
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
entrypoint: /entrypoint.sh
environment:
DB_HOST: postgres
DB_USER: postgres
DB_PASSWORD: postgres
DB_NAME: bookvita
DB_PORT: 5432
REDIS_URL: redis://redis:6379
DJANGO_SETTINGS_MODULE: server.settings_prod
ALLOWED_HOSTS: 'server'
PYTHONPATH: .
restart: always
client:
build: ./client/
ports:
- "5173:5173"
networks:
- web
depends_on:
- server
- redis
- postgres
environment:
SERVER_URL: http://server:8000
networks:
database:
driver: bridge
web:
driver: bridge
volumes:
redis-data:
postgres-data: