version: "3.9"

services:

  # https://hub.docker.com/r/linuxserver/mastodon
  # https://sleeplessbeastie.eu/2022/05/02/how-to-take-advantage-of-docker-to-install-mastodon/

  mastodon:
    image: linuxserver/mastodon:4.1.0
    container_name: mastodon
    environment:
      PUID: 1000
      PGID: 1000
      TZ: Etc/UTC
      LOCAL_DOMAIN: example.com
      REDIS_HOST: redis
      REDIS_PORT: 6379
      DB_HOST: db
      DB_USER: mastodon
      DB_NAME: mastodon
      DB_PASS: mastodon
      DB_PORT: 5432
      ES_ENABLED: false
      SECRET_KEY_BASE: 
      OTP_SECRET: 
      VAPID_PRIVATE_KEY: 
      VAPID_PUBLIC_KEY: 
      SMTP_SERVER: mail.example.com
      SMTP_PORT: 25
      SMTP_LOGIN: 
      SMTP_PASSWORD: 
      SMTP_FROM_ADDRESS: notifications@example.com
      S3_ENABLED: false
      # WEB_DOMAIN: mastodon.example.com #optional
      # ES_HOST: es #optional
      # ES_PORT: 9200 #optional
      # ES_USER: elastic #optional
      # ES_PASS: elastic #optional
      # S3_BUCKET:  #optional
      # AWS_ACCESS_KEY_ID:  #optional
      # AWS_SECRET_ACCESS_KEY:  #optional
      # S3_ALIAS_HOST:  #optional
      # SIDEKIQ_ONLY: false #optional
      # SIDEKIQ_QUEUE:  #optional
      # SIDEKIQ_DEFAULT: false #optional
      # SIDEKIQ_THREADS: 5 #optional
      # DB_POOL: 5 #optional
    volumes:
      - ./volumes/mastodon/config:/config
    ports:
      - 80:80
      - 443:443
    restart: unless-stopped