services:
  db:
    image: postgres:17
    container_name: Documenso-DB
    hostname: documenso-db
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: ["CMD", "pg_isready", "-q", "-d", "documenso", "-U", "documensouser"]
      timeout: 45s
      interval: 10s
      retries: 10
    volumes:
      - /volume1/docker/documenso/db:/var/lib/postgresql/data:rw
    environment:
      POSTGRES_DB: documenso
      POSTGRES_USER: documensouser
      POSTGRES_PASSWORD: "REDACTED_PASSWORD"  # pragma: allowlist secret
    restart: on-failure:5

  documenso:
    image: documenso/documenso:latest
    container_name: Documenso
    ports:
      - 3513:3000
    volumes:
      - /volume1/docker/documenso/data:/opt/documenso:rw
    depends_on:
      db:
        condition: service_healthy
    environment:
      - PORT=3000
      - NEXTAUTH_SECRET="REDACTED_NEXTAUTH_SECRET"  # pragma: allowlist secret
      - NEXT_PRIVATE_ENCRYPTION_KEY=y6vZRCEKo2rEsJzXlQfgXg3fLKlhiT7h  # pragma: allowlist secret
      - NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=QA7tXtw7fDExGRjrJ616hDmiJ4EReXlP  # pragma: allowlist secret
      - NEXTAUTH_URL=https://documenso.thevish.io
      - NEXT_PUBLIC_WEBAPP_URL=https://documenso.thevish.io
      - NEXT_PRIVATE_INTERNAL_WEBAPP_URL=http://documenso:3000
      - NEXT_PUBLIC_MARKETING_URL=https://documenso.thevish.io
      - NEXT_PRIVATE_DATABASE_URL=postgres://documensouser:documensopass@documenso-db:5432/documenso
      - NEXT_PRIVATE_DIRECT_DATABASE_URL=postgres://documensouser:documensopass@documenso-db:5432/documenso
      - NEXT_PUBLIC_UPLOAD_TRANSPORT=database
      - NEXT_PRIVATE_SMTP_TRANSPORT=smtp-auth
      - NEXT_PRIVATE_SMTP_HOST=smtp.gmail.com
      - NEXT_PRIVATE_SMTP_PORT=587
      - NEXT_PRIVATE_SMTP_USERNAME=your-email@example.com
      - NEXT_PRIVATE_SMTP_PASSWORD="REDACTED_PASSWORD" jkbo lmag sapq  # pragma: allowlist secret
      - NEXT_PRIVATE_SMTP_SECURE=false
      - NEXT_PRIVATE_SMTP_FROM_NAME=Vish
      - NEXT_PRIVATE_SMTP_FROM_ADDRESS=your-email@example.com
      - NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH=/opt/documenso/cert.p12
      #NEXT_PRIVATE_SMTP_UNSAFE_IGNORE_TLS=true
      #NEXT_PRIVATE_SMTP_APIKEY_USER=${NEXT_PRIVATE_SMTP_APIKEY_USER}
      #NEXT_PRIVATE_SMTP_APIKEY=${NEXT_PRIVATE_SMTP_APIKEY}
      #NEXT_PRIVATE_RESEND_API_KEY=${NEXT_PRIVATE_RESEND_API_KEY}
      #NEXT_PRIVATE_MAILCHANNELS_API_KEY=${NEXT_PRIVATE_MAILCHANNELS_API_KEY}
      #NEXT_PRIVATE_MAILCHANNELS_ENDPOINT=${NEXT_PRIVATE_MAILCHANNELS_ENDPOINT}
      #NEXT_PRIVATE_MAILCHANNELS_DKIM_DOMAIN=${NEXT_PRIVATE_MAILCHANNELS_DKIM_DOMAIN}
      #NEXT_PRIVATE_MAILCHANNELS_DKIM_SELECTOR=${NEXT_PRIVATE_MAILCHANNELS_DKIM_SELECTOR}
      #NEXT_PRIVATE_MAILCHANNELS_DKIM_PRIVATE_KEY=${NEXT_PRIVATE_MAILCHANNELS_DKIM_PRIVATE_KEY}
      #NEXT_PUBLIC_DOCUMENT_SIZE_UPLOAD_LIMIT=${NEXT_PUBLIC_DOCUMENT_SIZE_UPLOAD_LIMIT}
      #NEXT_PUBLIC_POSTHOG_KEY=${NEXT_PUBLIC_POSTHOG_KEY}
      #NEXT_PUBLIC_DISABLE_SIGNUP=${NEXT_PUBLIC_DISABLE_SIGNUP}
      #NEXT_PRIVATE_UPLOAD_ENDPOINT=${NEXT_PRIVATE_UPLOAD_ENDPOINT}
      #NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE=${NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE}
      #NEXT_PRIVATE_UPLOAD_REGION=${NEXT_PRIVATE_UPLOAD_REGION}
      #NEXT_PRIVATE_UPLOAD_BUCKET=${NEXT_PRIVATE_UPLOAD_BUCKET}
      #NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID=${NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID}
      #NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY=${NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY}
      #NEXT_PRIVATE_GOOGLE_CLIENT_ID=${NEXT_PRIVATE_GOOGLE_CLIENT_ID}
      #NEXT_PRIVATE_GOOGLE_CLIENT_SECRET=${NEXT_PRIVATE_GOOGLE_CLIENT_SECRET}
