-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
79 lines (74 loc) · 1.78 KB
/
docker-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
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
version: '3.8'
services:
projects:
build:
context: ./services/projects
target: development
ports:
- "3000:3000"
- "4000:4000"
volumes:
- ./services/projects:/usr/src/app
- /usr/src/app/node_modules
- /usr/src/app/dist
environment:
- PORT=3000
- DATABASE_URL=postgresql://testuser:testpass@database:5432/testdb
- DB_USER=testuser
- DB_PASSWORD=testpass
- DB_NAME=testdb
- DB_HOST=database
- DB_PORT=5432
command: sh -c "chmod +x ./wait-for-db.sh && ./wait-for-db.sh database npm run dev:docker"
depends_on:
database:
condition: service_healthy
networks:
- app-network
restart: unless-stopped
database:
image: postgres:17
environment:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpass
POSTGRES_DB: testdb
ports:
- "5432:5432"
volumes:
- db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U testuser -d testdb -h localhost"]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
networks:
- app-network
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "8080:3000"
volumes:
- ./frontend:/usr/src/app:delegated
- /usr/src/app/.next
- /usr/src/app/node_modules
environment:
- WATCHPACK_POLLING=true
- CHOKIDAR_USEPOLLING=true
- NEXT_WEBPACK_USEPOLLING=1
- NEXT_PUBLIC_API_URL=http://localhost:3000
- NODE_ENV=development
command: sh -c "npm install --legacy-peer-deps && npm run dev"
networks:
- app-network
stdin_open: true
tty: true
volumes:
db-data:
networks:
app-network:
driver: bridge
preview-network:
driver: bridge