feat(docker): fix healthcheck requiring `curl`, and updating healthcheck port

asdf
This commit is contained in:
perf3ct 2025-08-14 19:01:32 +00:00
parent 67ae68745c
commit e0f284e8e5
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
3 changed files with 16 additions and 2 deletions

View File

@ -85,6 +85,7 @@ RUN apt-get update && apt-get install -y \
ca-certificates \ ca-certificates \
poppler-utils \ poppler-utils \
ocrmypdf \ ocrmypdf \
curl \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
WORKDIR /app WORKDIR /app

View File

@ -72,7 +72,7 @@ services:
condition: service_healthy condition: service_healthy
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"] test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
interval: 30s interval: 30s
timeout: 10s timeout: 10s
retries: 3 retries: 3

View File

@ -215,12 +215,21 @@ services:
## Health Checks ## Health Checks
Add health checks to your Docker configuration: Add health checks to your Docker configuration. The Readur Docker image includes `curl` for health checking.
**Important:** The port in the healthcheck URL must match your `SERVER_PORT` or the port specified in `SERVER_ADDRESS`:
```yaml ```yaml
services: services:
readur: readur:
environment:
# If using SERVER_ADDRESS
- SERVER_ADDRESS=0.0.0.0:8000 # Port 8000
# Or if using SERVER_PORT
# - SERVER_PORT=8000 # Port 8000
healthcheck: healthcheck:
# Port in URL must match the SERVER_PORT/SERVER_ADDRESS port above
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"] test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
interval: 30s interval: 30s
timeout: 10s timeout: 10s
@ -228,6 +237,10 @@ services:
start_period: 40s start_period: 40s
``` ```
For example, if you change the server to run on port 3000:
- Set `SERVER_PORT=3000` or `SERVER_ADDRESS=0.0.0.0:3000`
- Update healthcheck to: `http://localhost:3000/api/health`
## Backup Strategy ## Backup Strategy
Create an automated backup script: Create an automated backup script: