generated from mathieusouflis/turborepo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
61 lines (57 loc) · 1.46 KB
/
docker-compose.yml
File metadata and controls
61 lines (57 loc) · 1.46 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
version: "3.8"
services:
# PostgreSQL database for backend
postgres:
image: postgres:16-alpine
container_name: turing-postgres
environment:
DB_USER: postgres
DB_PASSWORD: postgres
DB_NAME: turing_machine
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
# Backend API service
backend:
build:
context: .
dockerfile: apps/backend/Dockerfile
container_name: turing-backend
ports:
- "8080:8080"
environment:
DB_URL: postgresql://postgres:postgres@postgres:5432/turing_machine
NODE_ENV: development
depends_on:
postgres:
condition: service_healthy
volumes:
- ./apps/backend:/app/apps/backend
- ./packages:/app/packages
- /app/node_modules
- /app/apps/backend/node_modules
command: sh -c "pnpm --filter backend build && pnpm --filter backend dev"
# Frontend service
frontend:
build:
context: .
dockerfile: apps/frontend/Dockerfile
container_name: turing-frontend
ports:
- "5173:5173"
environment:
VITE_API_URL: http://localhost:8080
volumes:
- ./apps/frontend:/app/apps/frontend
- ./packages:/app/packages
- /app/node_modules
- /app/apps/frontend/node_modules
command: pnpm --filter frontend dev
volumes:
postgres_data: