Repository navigation
Run the server in Docker for the new lab server - #3
Merged
Merged
Conversation
- Dockerfile: Python 3.11 on Debian 12 (as on the old server), with the system libraries WeasyPrint and RDKit need and DejaVu fonts for labels. Runs gunicorn as uid 1000 with one worker and a 600 s timeout (matching the timer client's wait). Lab timezone, so "Opened" dates are local. - constraints.txt pins the package versions the tests were run against. - deploy/compose.yaml builds from the checkout and mounts config.yaml and secrets.yaml (never baked into the image). Joins lab-net for the edge proxy and listens on 127.0.0.1:5001 for the local timer client. Refuses to start if either file is missing instead of creating empty folders. - CI builds the image, runs the offline tests inside it, and smoke-tests /ping and a label PDF (checks the text renders in DejaVu). - client/install.sh accepts ELN_SERVER_URL to point the timers at the server without editing the unit files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
eln_server is moving from the old droplet (a systemd service on a venv, gunicorn serving TLS itself) to the new lab server, where each app runs in Docker behind the shared Caddy edge proxy. The lab's address stays the same,
https://eln.ddomlab.org:5000: Caddy will send/pth/...to the PTH container and everything else to this one (separate PR in ddomlab/lab-edge).What's added
Dockerfile--timeout 600to match the timer client, access log to stdout. Healthcheck on/ping.constraints.txtdeploy/compose.yamlconfig.yaml(writable, because the settings page saves to it) andsecrets.yaml(read-only) from the repo root. Joinslab-net, publishes only127.0.0.1:5001for the timers on the same host.cap_drop: ALL,no-new-privileges, 512 MB memory cap. Won't start if either file is missing, instead of Docker silently creating empty folders..dockerignore.gitout of the image..github/workflows/docker-image.yml/ping,/and a label PDF (asserts the text renders in DejaVu). Nothing is published.client/install.shELN_SERVER_URL=...to point the timers at the server at install time.README.mdBehavior change
Container time is America/New_York, like the eLabFTW container. The old server ran in UTC, so bottles opened after 8 PM Eastern were stamped with the next day's "Opened" date.
Tested locally (Docker Desktop, arm64)
docker compose upwith this compose file: healthy, runs aseln, 512 MB limit, all capabilities dropped./pinganswers on127.0.0.1:5001and aseln-server:5000from another container onlab-net.config.yamlthrough the mount.secrets.yamlmissing, compose refuses to start ("bind source path does not exist").🤖 Generated with Claude Code