76 lines
2.2 KiB
YAML
76 lines
2.2 KiB
YAML
# Customer-Portal für Coolify
|
|
# ============================
|
|
#
|
|
# WICHTIG in Coolify UI:
|
|
# 1. "Connect To Predefined Network" aktivieren
|
|
# 2. Domain NUR für portal setzen
|
|
# 3. Environment Variables im UI ausfüllen
|
|
#
|
|
# AUTOMATISCH beim Start:
|
|
# - Wartet auf PostgreSQL
|
|
# - Führt flask db upgrade aus
|
|
# - Startet Gunicorn
|
|
#
|
|
# Domain: https://portal.islandpferde-melanieworbs.de
|
|
# Port: 8000
|
|
|
|
services:
|
|
portal:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.production
|
|
container_name: customer-portal
|
|
restart: unless-stopped
|
|
expose:
|
|
- 8000
|
|
environment:
|
|
- FLASK_ENV=production
|
|
- FLASK_APP=customer_portal
|
|
- DATABASE_URL=postgresql://portal:${DB_PASSWORD:?DB Passwort erforderlich}@portal-db:5432/customer_portal
|
|
- SECRET_KEY=${SECRET_KEY:?Secret Key erforderlich}
|
|
- PORTAL_URL=https://portal.islandpferde-melanieworbs.de
|
|
# WordPress API
|
|
- WP_API_URL=${WP_API_URL:-https://kurse.islandpferde-melanieworbs.de/wp-json}
|
|
- WP_API_SECRET=${WP_API_SECRET:-}
|
|
# Video API
|
|
- VIDEO_API_URL=${VIDEO_API_URL:-https://videos.islandpferde-melanieworbs.de}
|
|
- VIDEO_API_KEY=${VIDEO_API_KEY:?Video API Key erforderlich}
|
|
# Email (optional)
|
|
- MAIL_SERVER=${MAIL_SERVER:-}
|
|
- MAIL_PORT=${MAIL_PORT:-587}
|
|
- MAIL_USE_TLS=${MAIL_USE_TLS:-true}
|
|
- MAIL_USERNAME=${MAIL_USERNAME:-}
|
|
- MAIL_PASSWORD=${MAIL_PASSWORD:-}
|
|
- MAIL_DEFAULT_SENDER=${MAIL_DEFAULT_SENDER:-}
|
|
depends_on:
|
|
portal-db:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
|
|
portal-db:
|
|
image: postgres:17-alpine
|
|
container_name: portal-db
|
|
restart: unless-stopped
|
|
# KEIN ports: - DB ist nur intern!
|
|
environment:
|
|
- POSTGRES_USER=portal
|
|
- POSTGRES_PASSWORD=${DB_PASSWORD:?DB Passwort erforderlich}
|
|
- POSTGRES_DB=customer_portal
|
|
volumes:
|
|
- portal_db_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U portal -d customer_portal"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 10s
|
|
|
|
volumes:
|
|
portal_db_data:
|
|
name: customer-portal_postgres_data
|