services:
  db:
    container_name: db
    image: postgres:17
    environment:
      POSTGRES_DB: pinepods_database
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: myS3curepass
      PGDATA: /var/lib/postgresql/data/pgdata
    volumes:
      - /home/user/pinepods/pgdata:/var/lib/postgresql/data
    restart: always

  valkey:
    image: valkey/valkey:8-alpine
    restart: always

  pinepods:
    image: madeofpendletonwool/pinepods:latest
    ports:
      - "8040:8040"
    environment:
      # Basic Server Info
      SEARCH_API_URL: "https://search.pinepods.online/api/search"
      PEOPLE_API_URL: "https://people.pinepods.online"
      HOSTNAME: "http://localhost:8040"
      # Database Vars
      DB_TYPE: postgresql
      DB_HOST: db
      DB_PORT: 5432
      DB_USER: postgres
      DB_PASSWORD: myS3curepass
      DB_NAME: pinepods_database
      # Valkey Settings
      VALKEY_HOST: valkey
      VALKEY_PORT: 6379
      # Enable or Disable Debug Mode for additional Printing
      DEBUG_MODE: false
      PUID: ${UID:-911}
      PGID: ${GID:-911}
      # Add timezone configuration
      TZ: "America/New_York"
      # Language Configuration
      DEFAULT_LANGUAGE: "en"
    volumes:
      # Mount the download and backup locations on the server
      - /home/user/pinepods/downloads:/opt/pinepods/downloads
      - /home/user/pinepods/backups:/opt/pinepods/backups
      # Timezone volumes, HIGHLY optional. Read the timezone notes below
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
    restart: always
    depends_on:
      - db
      - valkey
