-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
39 lines (37 loc) · 862 Bytes
/
docker-compose.yml
File metadata and controls
39 lines (37 loc) · 862 Bytes
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
services:
postgres:
image: postgres:16-alpine
container_name: treeo2_postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
ports:
- '${DB_PORT}:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${DB_USER} -d ${DB_NAME}']
interval: 10s
timeout: 5s
retries: 5
backend:
build: .
container_name: treeo2_backend
restart: unless-stopped
ports:
- '${PORT}:3000'
depends_on:
postgres:
condition: service_healthy
env_file:
- .env
command: >
sh -c "
npx prisma generate --schema ./prisma &&
npx prisma db push --schema ./prisma &&
npm run dev
"
volumes:
postgres_data: