services:
  db:
    image: postgres:16
    container_name: Mealie-DB
    hostname: mealie-db
    mem_limit: 1g
    cpu_shares: 768
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: ["CMD", "pg_isready", "-q", "-d", "mealie", "-U", "mealieuser"]
      timeout: 45s
      interval: 10s
      retries: 10
    volumes:
      - /home/soenke/docker-data/mealie/db:/var/lib/postgresql/data:rw
    environment:
      POSTGRES_DB: mealie
      POSTGRES_USER: mealie
      POSTGRES_PASSWORD: "$hYx%uyO$IAUX3EhXvUtP$GMe4TLgoiLrBTN9nrXh&q8C0TWqp&ku%dEOUPT4GMZ"
    restart: on-failure:5

  mealie:
    image: ghcr.io/mealie-recipes/mealie:latest
    container_name: Mealie
    hostname: mealie
    mem_limit: 2g
    cpu_shares: 1024
    security_opt:
      - no-new-privileges:true
    read_only: false
    ports:
      - 9925:9000
    volumes:
      - /home/soenke/docker-data/mealie/data:/app/data/:rw
    environment:
      TZ: Europe/Berlin
      PUID: 1026
      PGID: 100
      MAX_WORKERS: 1
      WEB_CONCURRENCY: 1
      ALLOW_SIGNUP: true
      BASE_URL: https://mealie.domr.ovh
      DB_ENGINE: postgres
      POSTGRES_USER: mealie
      POSTGRES_PASSWORD: "$hYx%uyO$IAUX3EhXvUtP$GMe4TLgoiLrBTN9nrXh&q8C0TWqp&ku%dEOUPT4GMZ"
      POSTGRES_SERVER: mealie-db
      POSTGRES_PORT: 5432
      POSTGRES_DB: mealie
      SMTP_HOST: ${SYSTEM_EMAIL_SMTP_HOST}
      SMTP_PORT: ${SYSTEM_EMAIL_SMTP_PORT}
      SMTP_FROM_NAME: Mealie
      SMTP_AUTH_STRATEGY: TLS # Options: TLS, SSL, NONE
      SMTP_FROM_EMAIL: ${SYSTEM_EMAIL_USER}
      SMTP_USER: ${SYSTEM_EMAIL_USER}
      SMTP_PASSWORD: ${SYSTEM_EMAIL_PASSSWORD}
      OIDC_AUTH_ENABLED: true
      OIDC_PROVIDER_NAME: Domröse
      OIDC_CONFIGURATION_URL: https://auth.domr.ovh/application/o/mealie/.well-known/openid-configuration
      OIDC_CLIENT_ID: "oVmVbL9Ehd1KAjSgAseAMZw4LHV6gmUfsFEf2Akp"
      OIDC_CLIENT_SECRET: "WP2hs4qKjmEpKQabIvKCBgDwtlm534It526vs3Mg9lrBGgzswG9sCh0nw7ieW9y7D7OMRe0x2gkcHqcdP37LVMBgpR3f2rABSlOduhyZhPQKOUNBk79AQNxYr23Mdaud"
      OIDC_SIGNUP_ENABLED: true
      OIDC_USER_GROUP: mealie-users
      OIDC_ADMIN_GROUP: mealie-admins
      OIDC_AUTO_REDIRECT: true   # Optional: The login page will be bypassed and you will be sent directly to your Identity Provider.
      OIDC_REMEMBER_ME: true     # Optional: By setting this value to true, a session will be extended as if "Remember Me" was checked.
    restart: on-failure:5
    labels:
      kuma.tools.tag.name: 'Tools'
      kuma.tools.tag.color: '#FF9900'
      kuma.homelab.tag.name: 'Homelab'
      kuma.homelab.tag.color: '#FF9955'
      kuma.organization.tag.name: 'Organization'
      kuma.organization.tag.color: '#FF99AA'
      kuma.mealie.http.name: 'mealie'
      kuma.mealie.http.url: 'https://mealie.domr.ovh/'
      kuma.mealie.http.tag_names: '[{"name": "tools", "value": "" }, {"name": "organization", "value": "" }]'
    depends_on:
      db:
        condition: service_healthy
