-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathcompose.yml
49 lines (46 loc) · 1.04 KB
/
compose.yml
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
services:
postgres:
image: postgres:alpine
container_name: postgres-db
restart: always
environment:
- POSTGRES_HOST=postgres
- POSTGRES_USERNAME=postgres
- POSTGRES_PASSWORD=postgres
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
backend:
container_name: backend
build:
context: ./backend
environment:
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/mydb
- JWT_SECRET=your-secret
ports:
- "8787:8787"
depends_on:
postgres:
condition: service_healthy
volumes:
- ./backend:/app/backend
- /app/backend/node_modules
frontend:
container_name: frontend
build:
context: ./frontend
ports:
- "3000:3000"
depends_on:
- backend
volumes:
- ./frontend:/app/frontend
- /app/frontend/node_modules
volumes:
postgres-data: