Kansho/docker-compose.dev-env.yml
Lars af6fe55577
All checks were successful
Deploy Development / deploy (push) Successful in 54s
Test Suite / pytest-backend (push) Successful in 2m35s
Test Suite / smoke-dev (push) Successful in 1s
Test Suite / frontend-build (push) Successful in 15s
Allow remote detect in production until local Ollama is connected.
Keep KANSHO_ENV=production and require an explicit operator flag instead of treating Prod as Development. Promote to Prod only via merge commit on main.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-08 10:02:28 +02:00

86 lines
2.3 KiB
YAML

# Server development stack: /home/lars/docker/kansho-dev
# No fixed container_name — Compose prefixes with the project name.
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: "${DB_NAME:-kansho_dev}"
POSTGRES_USER: "${DB_USER:-kansho_dev}"
POSTGRES_PASSWORD: "${DB_PASSWORD:-dev_password_change_me}"
volumes:
- dev-kansho-db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-kansho_dev} -d ${DB_NAME:-kansho_dev}"]
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped
networks:
- dev-kansho-network
backend:
build:
context: ./backend
dockerfile: Dockerfile
environment:
KANSHO_DB_BACKEND: postgres
KANSHO_ENV: "${KANSHO_ENV:-development}"
KANSHO_DATA_DIR: /app/data
KANSHO_MEDIA_ROOT: /app/data/media
DB_HOST: postgres
DB_PORT: "5432"
DB_NAME: "${DB_NAME:-kansho_dev}"
DB_USER: "${DB_USER:-kansho_dev}"
DB_PASSWORD: "${DB_PASSWORD:-dev_password_change_me}"
APP_URL: "${APP_URL:-https://dev.kansho.jinkendo.de}"
ALLOWED_ORIGINS: "${ALLOWED_ORIGINS:-https://dev.kansho.jinkendo.de,http://192.168.2.49:3096,http://localhost:3096}"
KANSHO_PROVIDER_KEY: "${KANSHO_PROVIDER_KEY:-}"
KANSHO_DETECT_PROVIDER_KEY: "${KANSHO_DETECT_PROVIDER_KEY:-}"
KANSHO_ALLOW_REMOTE_DETECT: "${KANSHO_ALLOW_REMOTE_DETECT:-}"
volumes:
- dev-kansho-media:/app/data/media
ports:
- "${KANSHO_BACKEND_PORT:-8096}:8000"
depends_on:
postgres:
condition: service_healthy
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/health')",
]
interval: 10s
timeout: 5s
retries: 18
start_period: 90s
restart: unless-stopped
networks:
- dev-kansho-network
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_URL: ""
ports:
- "${KANSHO_FRONTEND_PORT:-3096}:80"
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
networks:
- dev-kansho-network
volumes:
dev-kansho-db-data:
dev-kansho-media:
networks:
dev-kansho-network:
driver: bridge