services:
  db:
    container_name: db
    image: mysql:9
    command: --wait_timeout=1800
    environment:
      MYSQL_TCP_PORT: 3306
      MYSQL_ROOT_PASSWORD: myS3curepass
      MYSQL_DATABASE: pinepods_database
      MYSQL_COLLATION_SERVER: utf8mb4_unicode_ci
      MYSQL_CHARACTER_SET_SERVER: utf8mb4
      MYSQL_INIT_CONNECT: "SET @@GLOBAL.max_allowed_packet=64*1024*1024;"
    volumes:
      - /home/user/pinepods/sql:/var/lib/mysql
    restart: always

  valkey:
    image: valkey/valkey:8-alpine

  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: mariadb
      DB_HOST: db
      DB_PORT: 3306
      DB_USER: root
      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 the backup location on the server if you want to. You could mount a nas to the downloads folder or something like that.
      # The backups directory is used if backups are made on the web version on pinepods. When taking backups on the client version it downloads them locally.

    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
    depends_on:
      - db
      - valkey
