-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
83 lines (79 loc) · 2.5 KB
/
Copy pathdocker-compose.yml
File metadata and controls
83 lines (79 loc) · 2.5 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
80
81
82
83
services:
db:
image: postgres:17
container_name: pmh-db
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-pmh_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pmh_password}
POSTGRES_DB: ${POSTGRES_DB:-pmh_db}
# ports:
# - "${POSTGRES_PORT:-5432}:5432" #Not exposing ports, using docker network for communication between services
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 5s
timeout: 5s
retries: 10
backend:
build:
context: ./back-end
dockerfile: Dockerfile
container_name: pmh-backend
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
NODE_ENV: development
PORT: 3000
FRONTEND_ORIGIN: ${FRONTEND_ORIGIN:-http://localhost:5173}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
OPENAI_VISION_MODEL: ${OPENAI_VISION_MODEL:-gpt-4.1-mini}
JWT_SECRET: ${JWT_SECRET:-change-me-in-production}
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN:-1d}
COOKIE_SECURE: ${COOKIE_SECURE:-false}
COOKIE_MAX_AGE_MS: ${COOKIE_MAX_AGE_MS:-86400000}
POSTGRES_HOST: ${POSTGRES_HOST:-pmh-db}
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
POSTGRES_USER: ${POSTGRES_USER:-pmh_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pmh_password}
POSTGRES_DB: ${POSTGRES_DB:-pmh_db}
ports:
- "${BACKEND_PORT:-3000}:3000"
volumes:
- ./back-end:/app
- backend_node_modules:/app/node_modules
command: sh -c "npm install && npm run dev"
# nginx:
# image: nginx:1.27-alpine
# container_name: pmh-nginx
# restart: unless-stopped
# depends_on:
# - backend
# # ports:
# # - "80:80" #Not exposing ports, using docker network for communication between services
# volumes:
# - ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
frontend:
build:
context: ./front-end
dockerfile: Dockerfile
container_name: pmh-frontend
restart: unless-stopped
depends_on:
- backend
environment:
VITE_API_URL: ${VITE_API_URL:-http://localhost:3000}
CHOKIDAR_USEPOLLING: "true"
ports:
- "${FRONTEND_PORT:-5173}:5173"
volumes:
- ./front-end:/app
- frontend_node_modules:/app/node_modules
command: sh -c "npm install && npm run dev -- --host 0.0.0.0 --port 5173"
volumes:
postgres_data:
backend_node_modules:
frontend_node_modules: