Skip to content

Commit fdb3770

Browse files
Update Docker healthchecks to use /health endpoint
- Change healthcheck URL from /login to /health in all Docker files - Add env_file support to docker-compose.build.yml for consistency - The /health endpoint provides comprehensive checks (database + storage) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent e547296 commit fdb3770

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ EXPOSE 4123
4747

4848
# Health check
4949
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
50-
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:4123/login').read()" || exit 1
50+
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:4123/health').read()" || exit 1
5151

5252
# Use entrypoint script to initialize database and start app
5353
ENTRYPOINT ["/app/docker-entrypoint.sh"]

docker-compose.build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ services:
3434
# condition: service_completed_successfully
3535
ports:
3636
- "0.0.0.0:${PORT:-4123}:4123" # Explicitly bind to all interfaces
37+
env_file:
38+
- .env
3739
environment:
38-
# Required: Generate a secure secret key
39-
- SECRET_KEY=${SECRET_KEY}
40-
# Application environment
40+
# These can override .env values if needed
4141
- FLASK_ENV=${FLASK_ENV:-production}
4242
- PORT=${PORT:-4123}
4343
- HOST=0.0.0.0
@@ -48,7 +48,7 @@ services:
4848
# Optional: Mount .env file if you prefer file-based config
4949
# - ./.env:/app/.env:ro
5050
healthcheck:
51-
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:4123/login').read()"]
51+
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:4123/health').read()"]
5252
interval: 30s
5353
timeout: 10s
5454
retries: 3

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
volumes:
1515
- ${DATA_PATH:-./data}:/app/data
1616
healthcheck:
17-
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:4123/login').read()"]
17+
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:4123/health').read()"]
1818
interval: 30s
1919
timeout: 10s
2020
retries: 3

0 commit comments

Comments
 (0)