Add Compose, Gitea deploy, and Postgres dual-backend on develop.
Use host ports 3006/8005 and 3096/8096 so Kansho does not collide with Bookstack on 3005 or the sister products. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
32acdc220b
commit
07479f6a9f
37 files changed
+1613
-102
No files matched your search
@@ -0,0 +1,87 @@
|
||||
# Production stack on the Raspberry Pi: /home/lars/docker/kansho
|
||||
# Secrets live in the host .env next to this file, never in Git.
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: kansho-db-prod
|
||||
environment:
|
||||
POSTGRES_DB: "${DB_NAME:-kansho}"
|
||||
POSTGRES_USER: "${DB_USER:-kansho}"
|
||||
POSTGRES_PASSWORD: "${DB_PASSWORD:?set DB_PASSWORD in .env}"
|
||||
volumes:
|
||||
- kansho-db-data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-kansho} -d ${DB_NAME:-kansho}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- kansho-network
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
container_name: kansho-api
|
||||
environment:
|
||||
KANSHO_DB_BACKEND: postgres
|
||||
KANSHO_ENV: "${KANSHO_ENV:-production}"
|
||||
KANSHO_DATA_DIR: /app/data
|
||||
KANSHO_MEDIA_ROOT: /app/data/media
|
||||
DB_HOST: postgres
|
||||
DB_PORT: "5432"
|
||||
DB_NAME: "${DB_NAME:-kansho}"
|
||||
DB_USER: "${DB_USER:-kansho}"
|
||||
DB_PASSWORD: "${DB_PASSWORD:?set DB_PASSWORD in .env}"
|
||||
APP_URL: "${APP_URL:-https://kansho.jinkendo.de}"
|
||||
ALLOWED_ORIGINS: "${ALLOWED_ORIGINS:-https://kansho.jinkendo.de}"
|
||||
KANSHO_PROVIDER_KEY: "${KANSHO_PROVIDER_KEY:-}"
|
||||
KANSHO_DETECT_PROVIDER_KEY: "${KANSHO_DETECT_PROVIDER_KEY:-}"
|
||||
volumes:
|
||||
- kansho-media:/app/data/media
|
||||
ports:
|
||||
- "${KANSHO_BACKEND_PORT:-8005}: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: 12
|
||||
start_period: 40s
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- kansho-network
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
VITE_API_URL: ""
|
||||
container_name: kansho-ui
|
||||
ports:
|
||||
- "${KANSHO_FRONTEND_PORT:-3006}:80"
|
||||
depends_on:
|
||||
backend:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- kansho-network
|
||||
|
||||
volumes:
|
||||
kansho-db-data:
|
||||
kansho-media:
|
||||
|
||||
networks:
|
||||
kansho-network:
|
||||
driver: bridge
|
||||
Reference in new issue
Block a user