# Production compose — pulls pre-built images from Gitea registry.
#
# Usage:
#   podman login git.lpl-mind.de
#   podman-compose -f podman-compose.prod.yml pull
#   podman-compose -f podman-compose.prod.yml up -d
#
# Required files:
#   - wg0.conf  (WireGuard configuration in the same directory)

services:
  vpn:
    image: git.lpl-mind.de/lukas.pupkalipinski/aniworld/vpn:latest
    container_name: vpn-wireguard
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
      - NET_RAW
    sysctls:
      - net.ipv4.ip_forward=1
      - net.ipv4.conf.all.src_valid_mark=1
    volumes:
      - /server/server_aniworld/wg0.conf:/etc/wireguard/wg0.conf:ro
      - /lib/modules:/lib/modules:ro
    ports:
      - "8000:8000"
    environment:
      - HEALTH_CHECK_INTERVAL=10
      - HEALTH_CHECK_HOST=1.1.1.1
      - LOCAL_PORTS=8000
      - PUID=1013
      - PGID=1001
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-sf", "--max-time", "5", "http://1.1.1.1"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 60s

  app:
    image: git.lpl-mind.de/lukas.pupkalipinski/aniworld/app:latest
    container_name: aniworld-app
    network_mode: "service:vpn"
    depends_on:
      vpn:
        condition: service_healthy
    environment:
      - PYTHONUNBUFFERED=1
      - PUID=1013
      - PGID=1001
    volumes:
      - /server/server_aniworld/data:/app/data
      - /server/server_aniworld/logs:/app/logs
      - /media/serien/Serien:/data
    restart: unless-stopped
