# This compose file is for demonstration only, do not use in prod.
version: "3.9"

x-uffizzi:
  ingress:
    service: app
    port: 3001

services:
  app:
    depends_on:
      - "postgres"
    image: registry.uffizzi.com/logto-io/logto:latest
    ports:
      - 3001:3001
    environment:
      TRUST_PROXY_HEADER: 1
      DB_URL: postgres://postgres:p0stgr3s@localhost:5432/logto
    deploy:
      resources:
        limits:
          memory: 2000M
    entrypoint: /bin/sh
    command:
      - "-c"
      - "npm run cli db seed -- --swe && ENDPOINT=$$UFFIZZI_URL npm start"

  postgres:
    image: postgres:14-alpine
    user: postgres
    environment:
      POSTGRES_USER: "postgres"
      POSTGRES_PASSWORD: "p0stgr3s"
    deploy:
      resources:
        limits:
          memory: 500M