-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
65 lines (62 loc) · 1.39 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
services:
db:
image: postgres:15
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_DB: db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- ./backend/public/db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d db"]
interval: 10s
timeout: 5s
retries: 5
test_db:
image: postgres:15
restart: unless-stopped
ports:
- "5431:5432"
environment:
POSTGRES_DB: test_db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- ./backend/public/test_db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d test_db"]
interval: 10s
timeout: 5s
retries: 5
web:
build:
context: ./backend
dockerfile: ./Dockerfile
command: uvicorn app.main:app --reload --workers 1 --host 0.0.0.0 --port 8000
env_file:
- ./backend/.env
volumes:
- ./backend:/usr/src/app
ports:
- 8004:8000
depends_on:
db:
condition: service_healthy
test_db:
condition: service_healthy
frontend:
build:
context: ./frontend
dockerfile: ./Dockerfile
env_file:
- ./frontend/.env
command: npm start
volumes:
- ./frontend:/usr/src/app
ports:
- 3000:3000
depends_on:
- web