Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
74 lines (70 loc) · 1.82 KB
/
Copy pathdocker-compose.yml
File metadata and controls
74 lines (70 loc) · 1.82 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
services:
postgres:
image: postgres:16-alpine
container_name: cerina-postgres
environment:
POSTGRES_USER: cerina
POSTGRES_PASSWORD: cerina_dev_password
POSTGRES_DB: cerina
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U cerina -d cerina"]
interval: 5s
timeout: 5s
retries: 5
networks:
- cerina-network
backend:
build:
context: .
dockerfile: docker/backend.dockerfile
container_name: cerina-backend
env_file:
- .env
environment:
- DATABASE_URL=postgresql+asyncpg://cerina:cerina_dev_password@postgres:5432/cerina
- AGENTS_DATABASE_URL=postgresql://cerina:cerina_dev_password@postgres:5432/cerina
ports:
- "0.0.0.0:8000:8000"
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 30s
timeout: 10s
start_period: 10s
retries: 3
networks:
- cerina-network
frontend:
build:
context: .
dockerfile: docker/frontend.dockerfile
args:
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:8000/api/v1}
container_name: cerina-frontend
env_file:
- .env
ports:
- "3000:3000"
depends_on:
backend:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/"]
interval: 30s
timeout: 10s
start_period: 10s
retries: 3
networks:
- cerina-network
volumes:
postgres_data:
networks:
cerina-network:
driver: bridge