-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
89 lines (89 loc) · 2.17 KB
/
docker-compose.yml
File metadata and controls
89 lines (89 loc) · 2.17 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
86
87
88
89
services:
db:
image: postgres:16.13
container_name: jamplay_db
restart: unless-stopped
env_file:
- ./backend/.env.development
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 10
networks:
- jamplay_network
db-setup:
image: postgres:16.13
container_name: jamplay_db_setup
env_file:
- ./backend/.env.development
depends_on:
db:
condition: service_healthy
volumes:
- ./backend/prisma/sql/create-app-role.sql:/scripts/create-app-role.sql:ro
command: >
sh -c "
export PGPASSWORD=$${POSTGRES_PASSWORD} &&
psql
-h db
-p 5432
-U $${POSTGRES_USER}
-d $${POSTGRES_DB}
-v db_name=$${POSTGRES_DB}
-v db_app_user=$${DB_APP_USER}
-v db_app_password=$${DB_APP_PASSWORD}
-f /scripts/create-app-role.sql
"
restart: "no"
networks:
- jamplay_network
backend:
image: node:24
container_name: jamplay_backend
depends_on:
db-setup:
condition: service_completed_successfully
env_file:
- ./backend/.env.development
ports:
- "${BACKEND_PORT:-3000}:3000"
volumes:
- ./backend:/app
- backend_node_modules:/app/node_modules
working_dir: /app
command: >
sh -c "
export DATABASE_URL=postgresql://$${DB_APP_USER}:$${DB_APP_PASSWORD}@db:5432/$${POSTGRES_DB}?schema=public &&
corepack enable &&
pnpm install --force &&
pnpm prisma:generate &&
pnpm run start:dev
"
networks:
- jamplay_network
frontend:
image: node:24
container_name: jamplay_frontend
depends_on:
- backend
ports:
- "5173:5173"
volumes:
- ./frontend:/app
- frontend_node_modules:/app/node_modules
working_dir: /app
command: sh -c "corepack enable && pnpm install --force && pnpm run dev"
networks:
- jamplay_network
networks:
jamplay_network:
driver: bridge
volumes:
db_data:
backend_node_modules:
frontend_node_modules: