-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathcompose.yaml
More file actions
63 lines (58 loc) · 1.22 KB
/
compose.yaml
File metadata and controls
63 lines (58 loc) · 1.22 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
name: jetkvm-cloud-api
networks:
jetkvm:
driver: bridge
services:
db:
image: postgres
restart: unless-stopped
environment:
POSTGRES_PASSWORD: jetkvm
POSTGRES_USER: jetkvm
POSTGRES_DB: jetkvm
healthcheck:
test: ["CMD-SHELL", "pg_isready -U jetkvm -d jetkvm"]
interval: 5s
timeout: 5s
retries: 10
start_period: 5s
ports:
- "5432:5432"
networks:
- jetkvm
volumes:
- postgresql:/var/lib/postgresql
# Run database migrations before starting the apps
app-migrate:
build: .
env_file:
- .env
environment:
DATABASE_URL: postgres://jetkvm:jetkvm@db:5432/jetkvm
depends_on:
db:
condition: service_healthy
command: ["sh", "-c", "npx prisma migrate deploy"]
networks:
- jetkvm
restart: no
app:
build: .
restart: unless-stopped
env_file:
- .env
environment:
PORT: 3000
DATABASE_URL: postgres://jetkvm:jetkvm@db:5432/jetkvm
depends_on:
db:
condition: service_healthy
app-migrate:
condition: service_completed_successfully
ports:
- "3000:3000"
networks:
- jetkvm
volumes:
postgresql:
driver: local