version: "3"

services:
  tooljet:
    tty: true
    stdin_open: true
    container_name: Tooljet-app
    image: tooljet/tooljet:EE-LTS-latest
    restart: always
    env_file: .env
    deploy: # Please adjust the resource according to your usecase
      resources:
        limits:
          cpus: '1'
          memory: 2G
    ports:
      - 80:80
    environment:
      SERVE_CLIENT: "true"
      PORT: "80"
    command: npm run start:prod
  # Uncomment if ENABLE_TOOLJET_DB=true
  postgrest:
    image: postgrest/postgrest:v12.0.2
    restart: always
    env_file: .env
    deploy: # Please adjust the resource according to your usecase
      resources:
        limits:
          cpus: '1'
          memory: 1G
    environment:
      - PGRST_SERVER_PORT=80

  redis:
    container_name: ${REDIS_HOST}
    image: redis:6.2
    restart: always
    deploy: # Please adjust the resource according to your usecase
      resources:
        limits:
          cpus: '1'
          memory: 1G
    env_file:
      - .env
    environment:
      - MASTER=${REDIS_HOST}
      - REDIS_USER=${REDIS_USER}
      - REDIS_PASSWORD=${REDIS_PASSWORD}
