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
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,13 @@ RUN echo "GIT_COMMIT=${GIT_COMMIT}" > build.txt \

# Run command
EXPOSE 8000

# Add healthcheck to verify the API is responsive using the internal Python interpreter
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
CMD python3 -c "import os, urllib.request; \
port = os.getenv('SPOOLMAN_PORT', '8000'); \
base = os.getenv('SPOOLMAN_BASE_PATH', '').strip('/'); \
path = f'/{base}/api/v1/health'.replace('//', '/'); \
urllib.request.urlopen(f'http://localhost:{port}{path}')" || exit 1

ENTRYPOINT ["/home/app/spoolman/entrypoint.sh"]
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.8'
services:
spoolman:
image: ghcr.io/donkie/spoolman:latest # Also available at dockerhub: donkieyo/spoolman:latest
restart: unless-stopped
volumes:
# Mount the host machine's ./data directory into the container's /home/app/.local/share/spoolman directory
- ./data:/home/app/.local/share/spoolman # Do NOT modify /home/app/.local/share/spoolman target
ports:
# Map the host machine's port 7912 to the container's port 8000
- "7912:8000"
environment:
- TZ=Europe/Stockholm # Optional, defaults to UTC