-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcompose.yaml
More file actions
executable file
·62 lines (59 loc) · 1.83 KB
/
Copy pathcompose.yaml
File metadata and controls
executable file
·62 lines (59 loc) · 1.83 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
services:
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${DB_USER:-floodwise}
POSTGRES_PASSWORD: ${DB_PASSWORD:-floodwise}
POSTGRES_DB: ${DB_NAME:-floodwise}
ports:
- "${DB_PORT:-5432}:5432"
volumes:
- floodwise-db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-floodwise} -d ${DB_NAME:-floodwise}"]
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped
backend:
build:
context: ./backend
volumes:
- ./backend:/app
- ~/.config/earthengine:/root/.config/earthengine:ro
command: sh -c "python -m uvicorn main:app --host 0.0.0.0 --port 8000"
ports:
- "${BACKEND_PORT:-8000}:8000"
environment:
DATABASE_URL: postgresql+psycopg://${DB_USER:-floodwise}:${DB_PASSWORD:-floodwise}@db:5432/${DB_NAME:-floodwise}
APP_ENV: ${APP_ENV:-development}
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
frontend:
build:
context: ./my-react-app
volumes:
- ./my-react-app:/app
- frontend-node-modules:/app/node_modules
command: sh -c "if [ ! -d node_modules ] || [ -z \"$(ls -A node_modules 2>/dev/null)\" ]; then npm ci --no-audit --no-fund; fi && npm run dev -- --host 0.0.0.0 --port 5173"
ports:
- "${FRONTEND_PORT:-5173}:5173"
environment:
VITE_PROXY_TARGET: http://backend:8000
CHOKIDAR_USEPOLLING: "true"
WATCHPACK_POLLING: "true"
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
volumes:
floodwise-db-data:
frontend-node-modules: