name: big-bear-celestory-voltask
services:
  gateway:
    image: celestory/gateway:1.1.2
    container_name: celestory-gateway
    ports:
      - "1500:80"
    environment:
      SERVER_NAME: localhost
      FRONTEND_HOST: frontend
      FRONTEND_PORT: 80
      VOLTASK_HOST: voltask
      VOLTASK_PORT: 1401
      HUB_HOST: hub
      HUB_PORT: 1402
    depends_on:
      frontend:
        condition: service_healthy
      voltask:
        condition: service_healthy
      hub:
        condition: service_healthy
      api:
        condition: service_healthy
      auth:
        condition: service_healthy
      generator:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:80/"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped
    x-casaos:
      envs:
        - container: SERVER_NAME
          description:
            en_us: 'Container Variable: SERVER_NAME'
        - container: FRONTEND_HOST
          description:
            en_us: 'Container Variable: FRONTEND_HOST'
        - container: FRONTEND_PORT
          description:
            en_us: 'Container Variable: FRONTEND_PORT'
        - container: VOLTASK_HOST
          description:
            en_us: 'Container Variable: VOLTASK_HOST'
        - container: VOLTASK_PORT
          description:
            en_us: 'Container Variable: VOLTASK_PORT'
        - container: HUB_HOST
          description:
            en_us: 'Container Variable: HUB_HOST'
        - container: HUB_PORT
          description:
            en_us: 'Container Variable: HUB_PORT'
      ports:
        - container: "80"
          description:
            en_us: 'Container Port: 80'
  frontend:
    image: celestory/frontend:1.1.4
    container_name: celestory-frontend
    environment:
      CLOUD_API_URL: http://api
      ACCOUNT_API_URL: http://auth
      AUTH_CLIENT_ID: self_hosted_client
      AUTH_CLIENT_SECRET: self_hosted_secret
      AUTH_AUDIENCE: self_hosted
    depends_on:
      api:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:80/"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped
    x-casaos:
      envs:
        - container: CLOUD_API_URL
          description:
            en_us: 'Container Variable: CLOUD_API_URL'
        - container: ACCOUNT_API_URL
          description:
            en_us: 'Container Variable: ACCOUNT_API_URL'
        - container: AUTH_CLIENT_ID
          description:
            en_us: 'Container Variable: AUTH_CLIENT_ID'
        - container: AUTH_CLIENT_SECRET
          description:
            en_us: 'Container Variable: AUTH_CLIENT_SECRET'
        - container: AUTH_AUDIENCE
          description:
            en_us: 'Container Variable: AUTH_AUDIENCE'
  hub:
    image: celestory/hub:1.1.0
    container_name: celestory-hub
    environment:
      AUTH_ORIGIN: http://auth
      AUTH_AUDIENCE: self_hosted
      AUTH_AUTHORITY_SECRET: ${AUTH_AUTHORITY_SECRET}
      AUTH_JWKS_URI: http://auth/.well-known/jwks.json
      DB_VOLTASK_URL: postgres://celestory_admin:celestory_postgres_password_@db/voltask
      DB_HUB_URL: postgres://celestory_admin:celestory_postgres_password_@db/hub
      ADMIN_USERNAME: ${ADMIN_USERNAME}
      ADMIN_PASSWORD: ${ADMIN_PASSWORD}
      PORT: 1402
      ORIGIN: ${HUB_ORIGIN}
    depends_on:
      db:
        condition: service_healthy
      auth:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "node", "-e", "require('http').get('http://127.0.0.1:1402/')"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped
    x-casaos:
      envs:
        - container: AUTH_ORIGIN
          description:
            en_us: 'Container Variable: AUTH_ORIGIN'
        - container: AUTH_AUDIENCE
          description:
            en_us: 'Container Variable: AUTH_AUDIENCE'
        - container: AUTH_AUTHORITY_SECRET
          description:
            en_us: 'Container Variable: AUTH_AUTHORITY_SECRET'
        - container: AUTH_JWKS_URI
          description:
            en_us: 'Container Variable: AUTH_JWKS_URI'
        - container: DB_VOLTASK_URL
          description:
            en_us: 'Container Variable: DB_VOLTASK_URL'
        - container: DB_HUB_URL
          description:
            en_us: 'Container Variable: DB_HUB_URL'
        - container: ADMIN_USERNAME
          description:
            en_us: 'Container Variable: ADMIN_USERNAME'
        - container: ADMIN_PASSWORD
          description:
            en_us: 'Container Variable: ADMIN_PASSWORD'
        - container: PORT
          description:
            en_us: 'Container Variable: PORT'
        - container: ORIGIN
          description:
            en_us: 'Container Variable: ORIGIN'
  api:
    image: celestory/api:1.1.3
    container_name: celestory-api
    volumes:
      - /DATA/AppData/$AppID/projectFiles:/app/projectFiles
    environment:
      PORT: 80
      SELF_HOSTED: "true"
      STORAGE_SOLUTION: filesystem
      AUTH_DOMAIN: http://auth
      DB_URL: postgres://celestory_admin:celestory_postgres_password_@db/celestory
      AUTH_JWKS_URI: http://auth/.well-known/jwks.json
      AUTH_CLIENT_ID: self_hosted_client
      AUTH_CLIENT_SECRET: self_hosted_secret
      AUTH_AUDIENCE: self_hosted
      GENERATOR_URL: http://generator
      ORIGIN: ${API_ORIGIN}
    depends_on:
      db:
        condition: service_healthy
      auth:
        condition: service_healthy
      hub:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "node", "-e", "require('http').get('http://127.0.0.1:80/')"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped
    x-casaos:
      envs:
        - container: PORT
          description:
            en_us: 'Container Variable: PORT'
        - container: SELF_HOSTED
          description:
            en_us: 'Container Variable: SELF_HOSTED'
        - container: STORAGE_SOLUTION
          description:
            en_us: 'Container Variable: STORAGE_SOLUTION'
        - container: AUTH_DOMAIN
          description:
            en_us: 'Container Variable: AUTH_DOMAIN'
        - container: DB_URL
          description:
            en_us: 'Container Variable: DB_URL'
        - container: AUTH_JWKS_URI
          description:
            en_us: 'Container Variable: AUTH_JWKS_URI'
        - container: AUTH_CLIENT_ID
          description:
            en_us: 'Container Variable: AUTH_CLIENT_ID'
        - container: AUTH_CLIENT_SECRET
          description:
            en_us: 'Container Variable: AUTH_CLIENT_SECRET'
        - container: AUTH_AUDIENCE
          description:
            en_us: 'Container Variable: AUTH_AUDIENCE'
        - container: GENERATOR_URL
          description:
            en_us: 'Container Variable: GENERATOR_URL'
        - container: ORIGIN
          description:
            en_us: 'Container Variable: ORIGIN'
      volumes:
        - container: /app/projectFiles
          description:
            en_us: 'Container Path: /app/projectFiles'
  generator:
    image: celestory/generator:1.1.2
    container_name: celestory-generator
    volumes:
      - /DATA/AppData/$AppID/projectFiles:/usr/src/app/projectFiles
    environment:
      PORT: 80
      PROJECT_FILES_PATH: /usr/src/app/projectFiles
      STORAGE_SOLUTION: filesystem
      PROJECT_FILES_PREFIX: /celestory/api/filesystem/
    depends_on:
      api:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "node", "-e", "require('http').get('http://127.0.0.1:80/')"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped
    x-casaos:
      envs:
        - container: PORT
          description:
            en_us: 'Container Variable: PORT'
        - container: PROJECT_FILES_PATH
          description:
            en_us: 'Container Variable: PROJECT_FILES_PATH'
        - container: STORAGE_SOLUTION
          description:
            en_us: 'Container Variable: STORAGE_SOLUTION'
        - container: PROJECT_FILES_PREFIX
          description:
            en_us: 'Container Variable: PROJECT_FILES_PREFIX'
      volumes:
        - container: /usr/src/app/projectFiles
          description:
            en_us: 'Container Path: /usr/src/app/projectFiles'
  auth:
    image: celestory/auth:1.1.1
    container_name: celestory-auth
    environment:
      PORT: 80
      DB_HOST: db
      DB_DATABASE: auth
      DB_USERNAME: celestory_admin
      DB_PASSWORD: celestory_postgres_password_
      API_AUTHORITY_SECRET: ${AUTH_AUTHORITY_SECRET}
      API_OAUTH_ISSUER: celestory_auth
      SELF_HOSTED_REDIRECT_URI: ${AUTH_REDIRECT_URI}
      GENERATE_KEYS: true
      API_ACCESS_TOKEN_TTL: 604800
      API_REFRESH_TOKEN_TTL: 1209600
      USE_SELF_HOSTED_CLIENT: true
    depends_on:
      db:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "node", "-e", "require('http').get('http://127.0.0.1:80/')"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped
    x-casaos:
      envs:
        - container: PORT
          description:
            en_us: 'Container Variable: PORT'
        - container: DB_HOST
          description:
            en_us: 'Container Variable: DB_HOST'
        - container: DB_DATABASE
          description:
            en_us: 'Container Variable: DB_DATABASE'
        - container: DB_USERNAME
          description:
            en_us: 'Container Variable: DB_USERNAME'
        - container: DB_PASSWORD
          description:
            en_us: 'Container Variable: DB_PASSWORD'
        - container: API_AUTHORITY_SECRET
          description:
            en_us: 'Container Variable: API_AUTHORITY_SECRET'
        - container: API_OAUTH_ISSUER
          description:
            en_us: 'Container Variable: API_OAUTH_ISSUER'
        - container: SELF_HOSTED_REDIRECT_URI
          description:
            en_us: 'Container Variable: SELF_HOSTED_REDIRECT_URI'
        - container: GENERATE_KEYS
          description:
            en_us: 'Container Variable: GENERATE_KEYS'
        - container: API_ACCESS_TOKEN_TTL
          description:
            en_us: 'Container Variable: API_ACCESS_TOKEN_TTL'
        - container: API_REFRESH_TOKEN_TTL
          description:
            en_us: 'Container Variable: API_REFRESH_TOKEN_TTL'
        - container: USE_SELF_HOSTED_CLIENT
          description:
            en_us: 'Container Variable: USE_SELF_HOSTED_CLIENT'
  voltask:
    image: celestory/voltask:1.0.8
    container_name: celestory-voltask
    environment:
      PORT: 1401
      DATABASE_URL: postgresql://celestory_admin:celestory_postgres_password_@db:5432/voltask?schema=voltask
      ORCHESTRATOR_URL: http://orchestrator:3003
      VOLTASK_URL: http://voltask:1401
      WEBHOOK_URL: ${VOLTASK_WEBHOOK_URL}
      CELESTORY_AUTH_URL: http://auth
      CELESTORY_AUTH_CLIENT_ID: self_hosted_client
      CELESTORY_AUTH_CLIENT_SECRET: self_hosted_secret
      LICENSE_API_URL: http://hub:1402/hub
      PLUGINS_BUN_URL: http://plugins-bun:8001
      PLUGINS_DENO_URL: http://plugins-deno:8002
      PREMISE: on-premise
      PREMISE_USER_EMAIL: ${VOLTASK_ADMIN_EMAIL}
      PREMISE_USER_PASSWORD: ${VOLTASK_ADMIN_PASSWORD}
      STORAGE_DIR: /app/uploads
    volumes:
      - /DATA/AppData/$AppID/uploads:/app/uploads
    depends_on:
      hub:
        condition: service_healthy
      plugins-bun:
        condition: service_healthy
      plugins-deno:
        condition: service_healthy
      orchestrator:
        condition: service_healthy
      db:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "node", "-e", "require('http').get('http://127.0.0.1:1401/voltask')"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped
    x-casaos:
      envs:
        - container: PORT
          description:
            en_us: 'Container Variable: PORT'
        - container: DATABASE_URL
          description:
            en_us: 'Container Variable: DATABASE_URL'
        - container: ORCHESTRATOR_URL
          description:
            en_us: 'Container Variable: ORCHESTRATOR_URL'
        - container: VOLTASK_URL
          description:
            en_us: 'Container Variable: VOLTASK_URL'
        - container: WEBHOOK_URL
          description:
            en_us: 'Container Variable: WEBHOOK_URL'
        - container: CELESTORY_AUTH_URL
          description:
            en_us: 'Container Variable: CELESTORY_AUTH_URL'
        - container: CELESTORY_AUTH_CLIENT_ID
          description:
            en_us: 'Container Variable: CELESTORY_AUTH_CLIENT_ID'
        - container: CELESTORY_AUTH_CLIENT_SECRET
          description:
            en_us: 'Container Variable: CELESTORY_AUTH_CLIENT_SECRET'
        - container: LICENSE_API_URL
          description:
            en_us: 'Container Variable: LICENSE_API_URL'
        - container: PLUGINS_BUN_URL
          description:
            en_us: 'Container Variable: PLUGINS_BUN_URL'
        - container: PLUGINS_DENO_URL
          description:
            en_us: 'Container Variable: PLUGINS_DENO_URL'
        - container: PREMISE
          description:
            en_us: 'Container Variable: PREMISE'
        - container: PREMISE_USER_EMAIL
          description:
            en_us: 'Container Variable: PREMISE_USER_EMAIL'
        - container: PREMISE_USER_PASSWORD
          description:
            en_us: 'Container Variable: PREMISE_USER_PASSWORD'
        - container: STORAGE_DIR
          description:
            en_us: 'Container Variable: STORAGE_DIR'
      volumes:
        - container: /app/uploads
          description:
            en_us: 'Container Path: /app/uploads'
  plugins-bun:
    image: celestory/voltask-plugins-bun:1.0.8
    container_name: celestory-plugins-bun
    restart: unless-stopped
    environment:
      PORT: 8001
    logging:
      driver: "json-file"
      options:
        max-size: "30m"
        max-file: "1"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8001/imap"]
      retries: 3
      timeout: 60s
      interval: 10s
      start_period: 10s
      start_interval: 10s
    x-casaos:
      envs:
        - container: PORT
          description:
            en_us: 'Container Variable: PORT'
  plugins-deno:
    image: celestory/voltask-plugins-deno:1.0.8
    container_name: celestory-plugins-deno
    restart: unless-stopped
    environment:
      PORT: 8002
    logging:
      driver: "json-file"
      options:
        max-size: "30m"
        max-file: "1"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8002/deno"]
      retries: 3
      timeout: 60s
      interval: 10s
      start_period: 10s
      start_interval: 10s
    x-casaos:
      envs:
        - container: PORT
          description:
            en_us: 'Container Variable: PORT'
  orchestrator:
    image: celestory/voltask-orchestrator:1.0.8
    container_name: celestory-orchestrator
    environment:
      PORT: 3003
      DATABASE_URL: postgresql://celestory_admin:celestory_postgres_password_@db:5432/orchestrator?sslmode=disable
    depends_on:
      db:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3003/statements"]
      retries: 3
      timeout: 60s
      interval: 10s
      start_period: 10s
      start_interval: 10s
    restart: unless-stopped
    x-casaos:
      envs:
        - container: PORT
          description:
            en_us: 'Container Variable: PORT'
        - container: DATABASE_URL
          description:
            en_us: 'Container Variable: DATABASE_URL'
  db:
    image: celestory/postgres:1.0.0
    container_name: celestory-db
    environment:
      POSTGRES_USER: celestory_admin
      POSTGRES_PASSWORD: celestory_postgres_password_
    volumes:
      - /DATA/AppData/$AppID/db:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U celestory_admin"]
      interval: 10s
      timeout: 60s
      retries: 3
    restart: unless-stopped
    x-casaos:
      envs:
        - container: POSTGRES_USER
          description:
            en_us: 'Container Variable: POSTGRES_USER'
        - container: POSTGRES_PASSWORD
          description:
            en_us: 'Container Variable: POSTGRES_PASSWORD'
      volumes:
        - container: /var/lib/postgresql/data
          description:
            en_us: 'Container Path: /var/lib/postgresql/data'
x-casaos:
  # Supported CPU architectures for this application
  architectures:
    - amd64
    - arm64
  # Main service for this application
  main: gateway
  # Detailed description for the application
  description:
    en_us: The all-in-one no-code platform for interactive storytelling and Voltask automation engine. Paid license required, no free tier available. Purchase a license at https://celestory.io/pricing
  # Brief tagline for the application
  tagline:
    en_us: No-code interactive storytelling & automation
  # Developer's information
  developer: celestory
  # Author of this particular configuration
  author: Celestory
  # Icon URL for the application
  icon: https://storage.googleapis.com/voltask-assets/celestory.png
  # Thumbnail image for the application (if any)
  thumbnail: https://storage.googleapis.com/voltask-assets/celestory.png
  # Title for the application
  title:
    en_us: Celestory & Voltask
  # Category under which the application falls
  category: Development
  # Default port mapping for the application
  port_map: "1500"
