-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
79 lines (75 loc) · 2.14 KB
/
docker-compose.yml
File metadata and controls
79 lines (75 loc) · 2.14 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
version: '3.8'
services:
postgres:
image: postgres:16-alpine
container_name: openfamily-db
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-openfamily}
POSTGRES_USER: ${POSTGRES_USER:-openfamily}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
- ./server/schema.sql:/docker-entrypoint-initdb.d/schema.sql
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-openfamily}" ]
interval: 10s
timeout: 5s
retries: 5
server:
build:
context: .
dockerfile: ./server/Dockerfile
container_name: openfamily-server
restart: unless-stopped
environment:
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_DB: ${POSTGRES_DB:-openfamily}
POSTGRES_USER: ${POSTGRES_USER:-openfamily}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
SERVER_PORT: 3001
NODE_ENV: production
JWT_SECRET: ${JWT_SECRET}
VAPID_PUBLIC_KEY: ${VAPID_PUBLIC_KEY}
VAPID_PRIVATE_KEY: ${VAPID_PRIVATE_KEY}
VAPID_SUBJECT: ${VAPID_SUBJECT}
CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost:3000}
ports:
- "3001:3001"
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: [ "CMD-SHELL", "wget -qO- http://localhost:3001/health >/dev/null 2>&1 || exit 1" ]
interval: 15s
timeout: 5s
retries: 5
start_period: 10s
volumes:
- ./server/uploads:/app/uploads
client:
build:
context: .
dockerfile: ./client/Dockerfile
args:
VITE_API_URL: ${VITE_API_URL:-http://localhost:3001}
VITE_WS_URL: ${VITE_WS_URL:-ws://localhost:3001}
container_name: openfamily-client
restart: unless-stopped
ports:
- "3000:80"
depends_on:
server:
condition: service_healthy
healthcheck:
test: [ "CMD-SHELL", "wget -qO- http://127.0.0.1 >/dev/null 2>&1 || exit 1" ]
interval: 20s
timeout: 5s
retries: 5
start_period: 10s
volumes:
postgres-data:
driver: local