# LUF – Compose für Test und Produktion. Der Unterschied liegt nur in Projektname, Env-Datei und Web-Port, # die das Deploy-Skript setzt (scripts/deploy.sh). Es gibt keine festen Host-Ports außer dem Web-Port. # # Pflicht-Variablen (vom Skript exportiert): LUF_ENV (test|prod), LUF_TAG, LUF_ENV_FILE, LUF_WEB_PORT # Medien: LUF_MEDIA_HOST (setzt das Deploy-Skript auf /srv/luf//media, NFS-Mount vom NAS). # Im Container gilt derselbe Pfad wie auf dem Host. Unterordner: # originals/ nur queue (lesen+schreiben); der Web-Prozess (app) hat KEINEN Zugriff (Architektur 03/08) # derived/ queue schreibt, app liest nur (private Ableitungen, Auslieferung nur über Signatur) # public/ queue schreibt, app liest nur (bewusst öffentliche Medien) # Pflicht in der Env-Datei: DB_DATABASE, DB_USERNAME, DB_PASSWORD (siehe deploy/luf.env.example) x-logging: &logging driver: json-file options: max-size: "10m" max-file: "3" services: db: image: postgres:17-alpine restart: unless-stopped environment: POSTGRES_DB: ${DB_DATABASE:?DB_DATABASE fehlt} POSTGRES_USER: ${DB_USERNAME:?DB_USERNAME fehlt} POSTGRES_PASSWORD: ${DB_PASSWORD:?DB_PASSWORD fehlt} volumes: - db-data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] interval: 5s timeout: 5s retries: 20 logging: *logging app: build: context: . target: app image: luf-app-${LUF_ENV:?}:${LUF_TAG:?} restart: unless-stopped env_file: ${LUF_ENV_FILE:?} environment: DB_HOST: db DB_PORT: "5432" MEDIA_PUBLIC_PATH: ${LUF_MEDIA_HOST:?}/public MEDIA_DERIVED_PATH: ${LUF_MEDIA_HOST:?}/derived MEDIA_ORIGINALS_PATH: ${LUF_MEDIA_HOST:?}/originals volumes: - storage-data:/var/www/html/storage - type: bind source: ${LUF_MEDIA_HOST:?}/derived target: ${LUF_MEDIA_HOST:?}/derived read_only: true bind: create_host_path: false - type: bind source: ${LUF_MEDIA_HOST:?}/public target: ${LUF_MEDIA_HOST:?}/public read_only: true bind: create_host_path: false depends_on: db: condition: service_healthy logging: *logging web: build: context: . target: web image: luf-web-${LUF_ENV:?}:${LUF_TAG:?} restart: unless-stopped ports: - "${LUF_WEB_PORT:?}:80" depends_on: - app logging: *logging queue: image: luf-app-${LUF_ENV:?}:${LUF_TAG:?} restart: unless-stopped command: ["php", "artisan", "queue:work", "--tries=3", "--timeout=3600", "--max-time=3600"] env_file: ${LUF_ENV_FILE:?} environment: DB_HOST: db DB_PORT: "5432" MEDIA_PUBLIC_PATH: ${LUF_MEDIA_HOST:?}/public MEDIA_DERIVED_PATH: ${LUF_MEDIA_HOST:?}/derived MEDIA_ORIGINALS_PATH: ${LUF_MEDIA_HOST:?}/originals volumes: - storage-data:/var/www/html/storage - type: bind source: ${LUF_MEDIA_HOST:?}/originals target: ${LUF_MEDIA_HOST:?}/originals bind: create_host_path: false - type: bind source: ${LUF_MEDIA_HOST:?}/derived target: ${LUF_MEDIA_HOST:?}/derived bind: create_host_path: false - type: bind source: ${LUF_MEDIA_HOST:?}/public target: ${LUF_MEDIA_HOST:?}/public bind: create_host_path: false depends_on: db: condition: service_healthy logging: *logging scheduler: image: luf-app-${LUF_ENV:?}:${LUF_TAG:?} restart: unless-stopped command: ["php", "artisan", "schedule:work"] env_file: ${LUF_ENV_FILE:?} environment: DB_HOST: db DB_PORT: "5432" volumes: - storage-data:/var/www/html/storage depends_on: db: condition: service_healthy logging: *logging volumes: db-data: storage-data: