-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
85 lines (79 loc) · 1.78 KB
/
Copy pathdocker-compose.yml
File metadata and controls
85 lines (79 loc) · 1.78 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
85
name: cvision
services:
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: cvision
POSTGRES_PASSWORD: cvision
POSTGRES_DB: cvision
healthcheck:
test: ["CMD-SHELL", "pg_isready -U cvision -d cvision"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- cvision-postgres-data:/var/lib/postgresql/data
networks:
- cvision-network
migrate:
build:
context: ./backend
target: runtime
env_file:
- ./backend/.env
environment: &backend-env
NODE_ENV: production
PORT: 4000
DATABASE_URL: postgresql://cvision:cvision@db:5432/cvision?schema=public
CORS_ORIGIN: http://localhost:8080
command: ["npx", "prisma", "migrate", "deploy"]
depends_on:
db:
condition: service_healthy
restart: "no"
networks:
- cvision-network
backend:
build:
context: ./backend
target: runtime
env_file:
- ./backend/.env
environment:
<<: *backend-env
depends_on:
db:
condition: service_healthy
migrate:
condition: service_completed_successfully
expose:
- "4000"
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://127.0.0.1:4000/api/health').then((response) => { if (!response.ok) process.exit(1); }).catch(() => process.exit(1))",
]
interval: 15s
timeout: 5s
retries: 5
start_period: 20s
networks:
- cvision-network
frontend:
build:
context: ./frontend
target: production
args:
VITE_API_BASE_URL: /api
depends_on:
backend:
condition: service_healthy
networks:
- cvision-network
volumes:
cvision-postgres-data:
networks:
cvision-network: