-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
55 lines (52 loc) · 1.7 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
55 lines (52 loc) · 1.7 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
services:
client:
build:
context: .
dockerfile: packages/client/Dockerfile.prod
args:
- VITE_API_URL=${VITE_API_URL}
- VITE_FIREBASE_API_KEY=${VITE_FIREBASE_API_KEY}
- VITE_FIREBASE_AUTH_DOMAIN=${VITE_FIREBASE_AUTH_DOMAIN}
- VITE_FIREBASE_PROJECT_ID=${VITE_FIREBASE_PROJECT_ID}
- VITE_FIREBASE_STORAGE_BUCKET=${VITE_FIREBASE_STORAGE_BUCKET}
- VITE_FIREBASE_MESSAGING_SENDER_ID=${VITE_FIREBASE_MESSAGING_SENDER_ID}
- VITE_FIREBASE_APP_ID=${VITE_FIREBASE_APP_ID}
- VITE_FIREBASE_MEASUREMENT_ID=${VITE_FIREBASE_MEASUREMENT_ID}
ports:
- "${CLIENT_PORT:-80}:80" # default to 80; set CLIENT_PORT in .env if you prefer 5173
depends_on:
- server
postgres:
image: postgres:15-alpine
restart: unless-stopped
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- POSTGRES_DB=${POSTGRES_DB:-app}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
server:
build:
context: .
dockerfile: packages/server/Dockerfile.prod
args:
- SERVER_PORT=${SERVER_PORT:-3001}
ports:
- "${SERVER_PORT:-3001}:${SERVER_PORT:-3001}"
env_file:
- .env
environment:
- NODE_ENV=production
- PORT=${SERVER_PORT:-3001}
- DATABASE_URL=postgres://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:5432/${POSTGRES_DB:-app}
depends_on:
- postgres
healthcheck:
test: ["CMD-SHELL","curl -f http://localhost:${SERVER_PORT:-3001}/api/health || exit 1"]
interval: 30s
timeout: 5s
retries: 3
volumes:
postgres_data: