5353c82066
Co-authored-by: Cursor <cursoragent@cursor.com>
57 lines
1.8 KiB
YAML
57 lines
1.8 KiB
YAML
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
container_name: photohost-db
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-photohost}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-photohost_secret}
|
|
POSTGRES_DB: ${POSTGRES_DB:-photohost}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-photohost} -d ${POSTGRES_DB:-photohost}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
web:
|
|
build: .
|
|
container_name: photohost-web
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${APP_PORT:-8080}:8000"
|
|
environment:
|
|
DATABASE_URL: postgresql://${POSTGRES_USER:-photohost}:${POSTGRES_PASSWORD:-photohost_secret}@db:5432/${POSTGRES_DB:-photohost}
|
|
SECRET_KEY: ${SECRET_KEY:-dev-secret-change-in-production}
|
|
MAX_UPLOAD_MB: ${MAX_UPLOAD_MB:-10}
|
|
UPLOAD_FOLDER: /app/uploads
|
|
ADMIN_USERNAME: ${ADMIN_USERNAME:-}
|
|
ADMIN_EMAIL: ${ADMIN_EMAIL:-}
|
|
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-}
|
|
DEFAULT_GROUP_QUOTA_MB: ${DEFAULT_GROUP_QUOTA_MB:-100}
|
|
GIT_REPO_PATH: /repo
|
|
GIT_REMOTE_URL: ${GIT_REMOTE_URL:-https://git.evilfox.cc/test2/fotohost.git}
|
|
ALLOW_GIT_DEPLOY: ${ALLOW_GIT_DEPLOY:-false}
|
|
CONTAINER_NAME: photohost-web
|
|
GIT_CONFIG_COUNT: "1"
|
|
GIT_CONFIG_KEY_0: safe.directory
|
|
GIT_CONFIG_VALUE_0: /repo
|
|
volumes:
|
|
- uploads_data:/app/uploads
|
|
- .:/repo
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=5)"]
|
|
interval: 15s
|
|
timeout: 10s
|
|
retries: 8
|
|
start_period: 40s
|
|
|
|
volumes:
|
|
postgres_data:
|
|
uploads_data:
|