version: "3"

services:
  tooljet:
    tty: true
    stdin_open: true
    image: tooljet/tooljet:ee-lts-latest
    restart: always
    env_file: .env
    # ports:
    #   - 80:80
    expose:
      - 80
    deploy: # Please adjust the resource according to your usecase
      resources:
        limits:
          cpus: '1'
          memory: 2G
    depends_on:
      - postgres
    environment:
      SERVE_CLIENT: "true"
      PORT: "80"
    command: npm run start:prod

  postgres:
    image: postgres:13
    restart: always
    deploy: # Please adjust the resource according to your usecase
      resources:
        limits:
          cpus: '2'
          memory: 3G
    volumes:
      - ../files/postgres:/var/lib/postgresql/data
    env_file: .env
    environment:
      - POSTGRES_USER=${PG_USER}
      - POSTGRES_PASSWORD=${PG_PASS}

volumes:
  certs:
  logs:
  fallbackcerts: