version: "3.9"

services:
  db:
    image: mariadb:11.4-noble # LTS Long Time Support until May 29, 2029
    container_name: RomM-DB
    security_opt:
      - no-new-privileges:false
    environment:
      MYSQL_DATABASE: romm
      MYSQL_USER: rommuser
      MYSQL_PASSWORD: "REDACTED_PASSWORD"
      MYSQL_ROOT_PASSWORD: "REDACTED_PASSWORD"
      TZ: America/Los_Angeles
    volumes:
      - /mnt/atlantis_docker/romm/db:/var/lib/mysql:rw
    restart: on-failure:5

  romm:
    image: rommapp/romm:latest
    container_name: RomM
    depends_on:
      - db
    ports:
      - "7676:8080"
    environment:
      ROMM_DB_DRIVER: mariadb
      DB_HOST: db
      DB_NAME: romm
      DB_USER: rommuser
      DB_PASSWD: "REDACTED_PASSWORD"
      DB_PORT: 3306
      ROMM_AUTH_SECRET_KEY: e9c36749cf1cb5f8df757bc0REDACTED_GITEA_TOKEN
      # Metadata providers (optional):
      # SCREENSCRAPER_USER:
      # SCREENSCRAPER_PASSWORD:
      # IGDB_CLIENT_ID:
      # IGDB_CLIENT_SECRET:
      # MOBYGAMES_API_KEY:
      # STEAMGRIDDB_API_KEY:
      # RETROACHIEVEMENTS_API_KEY:
      # HASHEOUS_API_ENABLED: true
    volumes:
      - /mnt/atlantis_docker/romm/resources:/romm/resources:rw
      - /mnt/atlantis_docker/romm/redis:/redis-data:rw
      - /mnt/atlantis_docker/romm/games/library:/romm/library:rw
      - /mnt/atlantis_docker/romm/games/assets:/romm/assets:rw
      - /mnt/atlantis_docker/romm/games/config:/romm/config:rw
    healthcheck:
      test: ["CMD", "curl", "-f", "http://127.0.0.1:8080/"]
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 90s
    restart: on-failure:10
