80 lines
1.7 KiB
YAML
80 lines
1.7 KiB
YAML
version: "3.9"
|
|
name: nocapwya
|
|
services:
|
|
db:
|
|
image: postgis/postgis:16-3.5
|
|
container_name: nocapwya-db
|
|
environment:
|
|
POSTGRES_DB: wya
|
|
POSTGRES_USER: wya
|
|
POSTGRES_PASSWORD: wya
|
|
volumes:
|
|
- pg_data:/var/lib/postgresql/data
|
|
- ./backend/app/init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U wya -d wya"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
networks:
|
|
- nocap_net
|
|
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
container_name: nocapwya-backend
|
|
command: uvicorn app.main:app --host 0.0.0.0 --port 8000
|
|
working_dir: /app
|
|
ports:
|
|
- "8000:8000"
|
|
volumes:
|
|
- ./backend:/app
|
|
- ./data:/data
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- PYTHONUNBUFFERED=1
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -fsS http://localhost:8000/ || exit 1"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 10
|
|
networks:
|
|
- nocap_net
|
|
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
container_name: nocapwya-frontend
|
|
command: sh -c "npm run preview -- --host 0.0.0.0 --port 4173"
|
|
working_dir: /app
|
|
ports:
|
|
- "4173:4173"
|
|
volumes:
|
|
- ./frontend:/app
|
|
- ./data/tiles:/app/dist/tiles:ro
|
|
environment:
|
|
- VITE_API_URL=http://backend:8000
|
|
depends_on:
|
|
backend:
|
|
condition: service_started
|
|
restart: unless-stopped
|
|
networks:
|
|
- nocap_net
|
|
|
|
volumes:
|
|
pg_data:
|
|
|
|
networks:
|
|
nocap_net:
|
|
driver: bridge
|
|
|
|
|