Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ NEXT_PUBLIC_URL=http://localhost:3000

# Authentication
AUTH_SECRET=NMKtKt29S8bYhbGRteHWurxlOSPXVg+DPswqNcZVZdA=
AUTH_TRUST_HOST=http://localhost:3000
AUTH_URL=http://localhost:3000

# Encryption
ENCRYPTION_KEY=WBNzRXdy/3vAdR0RBG+bkyY/PzFm9UWqp/E//J0nz9o=
Expand All @@ -36,4 +36,4 @@ TRIGGER_SECRET_KEY=
LANGSMITH_TRACING=false
LANGSMITH_ENDPOINT=https://api.smith.langchain.com
LANGSMITH_API_KEY=
LANGSMITH_PROJECT=
LANGSMITH_PROJECT=
2 changes: 1 addition & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LABEL authors="OpenHealth"
# Install coreutils for head
RUN apk add coreutils

RUN apk add -U graphicsmagick
RUN apk add -U graphicsmagick ghostscript

WORKDIR /app

Expand Down
21 changes: 19 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,24 @@ services:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s

docling-serve:
image: ghcr.io/ds4sd/docling-serve:latest
restart: always
ports:
- "5001:5001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5001/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s

app:
build:
Expand All @@ -22,15 +36,18 @@ services:
args:
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database:5432/${POSTGRES_DB}
depends_on:
- database
- docling-serve
database:
condition: service_healthy
docling-serve:
condition: service_started
Comment on lines +41 to +42

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The app service depends on docling-serve with condition: service_started. However, the docling-serve service has a healthcheck defined. Using condition: service_healthy would be more robust, as it ensures docling-serve is not just started, but is actually ready to accept requests before the app service starts. This can prevent race conditions and startup errors.

      docling-serve:
        condition: service_healthy

volumes:
- app_data:/app/public/uploads
ports:
- "3000:3000"
restart: always
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database:5432/${POSTGRES_DB}
DOCLING_URL: http://docling-serve:5001

volumes:
postgres_data:
Expand Down
Loading