Skip to content

Service fails healthchecks on coolify #2302

@yipfram

Description

@yipfram

Describe the bug
Healthcheck fails when accessing builder or viewer container.
To Reproduce

  1. Create a new Docker Compose file in coolify
  2. Paste the following Docker Compose file:
    (to better understand what's specific about docker compose for coolify: https://coolify.io/docs/knowledge-base/docker/compose)
# documentation: https://docs.typebot.io/self-hosting/deploy/docker
# slogan: Typebot is an open-source chatbot builder that allows you to create advanced conversational apps.
# category: development
# tags: chatbot, conversational, ai, forms, automation, builder, no-code, open-source
# logo: svgs/typebot.svg
# port: 8080

services:
  typebot-builder:
    image: baptistearno/typebot-builder:3.12.0
    environment:
      - SERVICE_URL_TYPEBOT-BUILDER_8080
      - DATABASE_URL=postgresql://$SERVICE_USER_POSTGRES:$SERVICE_PASSWORD_POSTGRES@typebot-db:5432/${POSTGRES_DB:-typebot}
      - REDIS_URL=redis://typebot-redis:6379
      - ENCRYPTION_SECRET=$SERVICE_BASE64_TYPEBOT
      - NEXTAUTH_URL=$SERVICE_URL_TYPEBOT-BUILDER
      - NEXT_PUBLIC_VIEWER_URL=$SERVICE_URL_TYPEBOT-VIEWER
      - GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
      - GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}
      - PORT=8080
      - HOSTNAME=0.0.0.0 # Added because the generated url was a random string, not accessible on 127.0.0.1 for healthchecks
    depends_on:
      typebot-db:
        condition: service_healthy
      typebot-redis:
        condition: service_healthy
    healthcheck:
      test:
        - CMD
        - wget
        - '--spider'
        - 'http://127.0.0.1:8080/api/health'
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 20s

  typebot-viewer:
    image: baptistearno/typebot-viewer:3.12.0
    environment:
      - SERVICE_URL_TYPEBOT-VIEWER_8081
      - DATABASE_URL=postgresql://$SERVICE_USER_POSTGRES:$SERVICE_PASSWORD_POSTGRES@typebot-db:5432/${POSTGRES_DB:-typebot}
      - REDIS_URL=redis://typebot-redis:6379
      - ENCRYPTION_SECRET=$SERVICE_BASE64_TYPEBOT
      - NEXTAUTH_URL=$SERVICE_URL_TYPEBOT-BUILDER
      - NEXT_PUBLIC_VIEWER_URL=$SERVICE_URL_TYPEBOT-VIEWER
      - PORT=8081
      - HOSTNAME=0.0.0.0 # Added because the generated url was a random string, not accessible on 127.0.0.1 for healthchecks
    depends_on:
      typebot-db:
        condition: service_healthy
      typebot-redis:
        condition: service_healthy
    healthcheck:
      test:
        - CMD
        - wget
        - '--spider'
        - 'http://127.0.0.1:8081/api/health'
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 20s

  typebot-db:
    image: postgres:16-alpine
    volumes:
      - typebot-db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=${POSTGRES_DB:-typebot}
      - POSTGRES_USER=$SERVICE_USER_POSTGRES
      - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
      interval: 5s
      timeout: 20s
      retries: 10

  typebot-redis:
    image: redis:alpine
    command: ["redis-server", "--save", "60", "1"]
    volumes:
      - typebot-redis-data:/data
    healthcheck:
      test: ["CMD-SHELL", "redis-cli ping || exit 1"]
      interval: 10s
      timeout: 1s
      retries: 3

  1. Go to logs, see:
   ▲ Next.js 15.4.1
   - Local:        http://localhost:8080
   - Network:      http://0.0.0.0:8080

 ✓ Starting...
 ✓ Ready in 2.4s
  1. See healthcheck not healthy

Expected behavior
Healthcheck should succeed since service is started
Screen recording

Image Image

Version of builder and viewer image: 3.12.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions