version: '3'

services:
  jellystat-db:
    image: postgres:15.2
    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
      POSTGRES_PASSWORD: mypassword
    volumes:
      - postgres-data:/var/lib/postgresql/data

  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
      POSTGRES_PASSWORD: mypassword
      POSTGRES_IP: jellystat-db
      POSTGRES_PORT: 5432
      JWT_SECRET: "my-secret-jwt-key"
      TZ: mytimezone # timezone (ex: Europe/Paris)
    volumes:
      - jellystat-backup-data:/app/backend/backup-data
    ports:
      - "3000:3000"
    depends_on:
      - jellystat-db
      
networks:
  default:

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