-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
59 lines (57 loc) · 1.49 KB
/
docker-compose.yml
File metadata and controls
59 lines (57 loc) · 1.49 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
services:
client:
build:
context: ./packages/client
args:
- CLIENT_PORT=${CLIENT_PORT}
volumes:
- ./packages/client:/app:delegated
- client_node_modules:/app/node_modules
- ./.env:/app/.env:ro
- ./tsconfig.base.json:/tsconfig.base.json:ro
ports:
- "${CLIENT_PORT:-5173}:${CLIENT_PORT:-5173}"
env_file:
- .env
environment:
- VITE_API_URL=http://server:${SERVER_PORT:-3001}
command: sh -c "npm install && npm run dev"
postgres:
image: postgres:15-alpine
restart: unless-stopped
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=app
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
server:
build:
context: ./packages/server
args:
- SERVER_PORT=${SERVER_PORT}
volumes:
- ./packages/server:/app:delegated
- server_node_modules:/app/node_modules
- ./.env:/app/.env:ro
ports:
- "${SERVER_PORT:-3001}:${SERVER_PORT:-3001}"
env_file:
- .env
environment:
- PORT=${SERVER_PORT}
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/app
depends_on:
- postgres
command: sh -c "npm install && npm run dev"
healthcheck:
test: ["CMD-SHELL","curl -f http://localhost:${SERVER_PORT:-3001}/api/health || exit 1"]
interval: 30s
timeout: 5s
retries: 3
volumes:
client_node_modules:
server_node_modules:
postgres_data: