feat(docker): fix healthcheck requiring `curl`, and updating healthcheck port
asdf
This commit is contained in:
parent
67ae68745c
commit
e0f284e8e5
|
|
@ -85,6 +85,7 @@ RUN apt-get update && apt-get install -y \
|
|||
ca-certificates \
|
||||
poppler-utils \
|
||||
ocrmypdf \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ services:
|
|||
condition: service_healthy
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"]
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
|
|
|||
|
|
@ -215,12 +215,21 @@ services:
|
|||
|
||||
## 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
|
||||
services:
|
||||
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:
|
||||
# Port in URL must match the SERVER_PORT/SERVER_ADDRESS port above
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
|
|
@ -228,6 +237,10 @@ services:
|
|||
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
|
||||
|
||||
Create an automated backup script:
|
||||
|
|
|
|||
Loading…
Reference in New Issue