x-arcane:
  icon: https://cdn.jsdelivr.net/gh/selfhst/icons@main/png/jellystat.png
  urls:
    - https://github.com/CyferShepard/Jellystat

services:
  jellystat-db:
    image: postgres:18.1
    shm_size: "1gb"
    container_name: jellystat-db
    restart: unless-stopped
    logging:
      driver: "json-file"
      options:
        max-file: "5"
        max-size: "10m"
    environment:
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    volumes:
      - postgres-data:/var/lib/postgresql
    healthcheck:
      test:
        - CMD-SHELL
        - pg_isready --dbname=postgres --username=postgres
      interval: 10s
      timeout: 5s
      retries: 5
    labels:
      com.getarcaneapp.arcane.icon: https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/postgresql.svg

  jellystat:
    image: cyfershepard/jellystat:latest
    container_name: jellystat
    restart: unless-stopped
    logging:
      driver: "json-file"
      options:
        max-file: "5"
        max-size: "10m"
    environment:
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_IP: jellystat-db
      POSTGRES_PORT: 5432
      JWT_SECRET: ${JWT_SECRET}
      TZ: ${TZ:-Etc/UTC}
    volumes:
      - jellystat-backup-data:/app/backend/backup-data
    ports:
      - "${APP_PORT:-3000}:3000"
    depends_on:
      jellystat-db:
        condition: service_healthy
    healthcheck:
      test: wget --no-verbose --tries=1 --spider http://localhost:3000/auth/isConfigured || exit 1
      interval: 60s
      timeout: 30s
      retries: 5
      start_period: 30s
    labels:
      com.getarcaneapp.arcane.icon: https://cdn.jsdelivr.net/gh/selfhst/icons@main/png/jellystat.png

networks:
  default:

volumes:
  postgres-data:
  jellystat-backup-data:
