x-environment: &default-environment
  DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
  VALKEY_URL: redis://valkey:6379 # Or set to blank string to disable
  SECRET_KEY: change_me_to_something_random # best to run openssl rand -hex 32
  EMAIL_URL: consolemail:// # Example smtp://email:password@smtp_url:port https://glitchtip.com/documentation/install#configuration
  GLITCHTIP_DOMAIN: https://glitchtip.example.com # Change this to your domain
  DEFAULT_FROM_EMAIL: email@example.com # Change this to your email
  ENABLE_ADMIN: "False" # Set to True to enable Django Admin at /admin/
  ENABLE_OPENAPI: "False" # Set to True to enable OpenAPI spec at /api/docs
  GLITCHTIP_ENABLE_MCP: "False" # Set to True to enable MCP server
  GLITCHTIP_ENABLE_DUCKDB: "False" # Set to True to enable cold storage archival
  # PORT: 8000 # If changing, change the web service port too

  ## To reduce RAM usage (targeting 256-512 MB), consider disabling:
  # VALKEY_URL: "" # Disable Valkey, use Postgres for task queue and cache
  # GLITCHTIP_ENABLE_LOGS: "False" # Disable log ingestion
  # GLITCHTIP_ENABLE_UPTIME: "False" # Disable uptime monitoring

x-depends_on: &default-depends_on
  - postgres
  - valkey # Remove when disabling Valkey

services:
  postgres:
    image: postgres:18
    environment:
      POSTGRES_HOST_AUTH_METHOD: "trust" # Consider removing this and setting a password
    restart: unless-stopped
    volumes:
      - pg-data:/var/lib/postgresql
  valkey: # Recommended. Remove this service when disabling Valkey.
    image: valkey/valkey:9
    restart: unless-stopped
  web:
    image: glitchtip/glitchtip:6 # Check https://glitchtip.com/blog/ for new major versions
    depends_on: *default-depends_on
    ports:
      - "8000:8000"
    environment:
      <<: *default-environment
      SERVER_ROLE: all_in_one
    restart: unless-stopped
    volumes:
      - uploads:/code/uploads

volumes:
  pg-data:
  uploads:
