# documentation: https://fider.io
# slogan: Fider is a feedback platform for collecting and managing user feedback.
# tags: feedback, user-feedback
# logo: svgs/fider.svg
# port: 3000

services:
  fider:
    image: getfider/fider:stable
    environment:
      - SERVICE_FQDN_FIDER_3000
      - BASE_URL=$SERVICE_FQDN_FIDER_3000
      - DATABASE_URL=postgres://$SERVICE_USER_POSTGRES:$SERVICE_PASSWORD_POSTGRES@database:5432/fider?sslmode=disable
      - JWT_SECRET=$SERVICE_PASSWORD_64_FIDER
      - EMAIL_NOREPLY=${EMAIL_NOREPLY:-noreply@example.com}
      - EMAIL_MAILGUN_API=$EMAIL_MAILGUN_API
      - EMAIL_MAILGUN_DOMAIN=$EMAIL_MAILGUN_DOMAIN
      - EMAIL_MAILGUN_REGION=$EMAIL_MAILGUN_REGION
      - EMAIL_SMTP_HOST=${EMAIL_SMTP_HOST:-smtp.mailgun.com}
      - EMAIL_SMTP_PORT=${EMAIL_SMTP_PORT:-587}
      - EMAIL_SMTP_USERNAME=${EMAIL_SMTP_USERNAME:-postmaster@mailgun.com}
      - EMAIL_SMTP_PASSWORD=$EMAIL_SMTP_PASSWORD
      - EMAIL_SMTP_ENABLE_STARTTLS=$EMAIL_SMTP_ENABLE_STARTTLS
      - EMAIL_AWSSES_REGION=$EMAIL_AWSSES_REGION
      - EMAIL_AWSSES_ACCESS_KEY_ID=$EMAIL_AWSSES_ACCESS_KEY_ID
      - EMAIL_AWSSES_SECRET_ACCESS_KEY=$EMAIL_AWSSES_SECRET_ACCESS_KEY
    healthcheck:
      test: ["CMD", "/app/fider", "ping"]
      interval: 2s
      timeout: 10s
      retries: 10
  database:
    image: postgres:12
    volumes:
      - pg_data:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=$SERVICE_USER_POSTGRES
      - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
      - POSTGRES_DB=${POSTGRES_DB:-fider}
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "$SERVICE_USER_POSTGRES"]
      interval: 5s
      timeout: 20s
      retries: 10
