Skip to content

fix(docker): complete the Node and Python image builds - #25

Merged
cport1 merged 1 commit into
mainfrom
fix/node-python-dockerfiles
Jul 28, 2026
Merged

fix(docker): complete the Node and Python image builds#25
cport1 merged 1 commit into
mainfrom
fix/node-python-dockerfiles

Conversation

@cport1

@cport1 cport1 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Both images copied only their entrypoint — server.js / server.py — without the modules those files import, so neither could start. Nothing in the repository references them, and the published Go image is unaffected.

Fix

Each image now copies every module its server imports. The layout inside the image mirrors the repository — server-node/ and client/ as siblings — so the widget resolves at ../client/fcaptcha.js with no configuration.

Both are therefore built from the repository root:

docker build -f server-node/Dockerfile -t fcaptcha-node .

Python keeps python server.py rather than a bare uvicorn invocation, because the __main__ block sets proxy_headers=False — which FCaptcha requires so TRUSTED_PROXIES is the only thing resolving a client address.

Verified by running each container

image health /fcaptcha.js /api/pow/challenge E2E suite
node 200 200 200 93/93
python 200 200 200 80/93

Each scores exactly what that server scores natively — Python's 13 are the implementation's documented divergences, not something the image introduces.

Coverage

docker-smoke now runs over all three images, checking startup, the widget endpoint, the challenge endpoint and the startup log. The demo-page assertion stays specific to the published image.

These are packaging checks, covering a gap unit tests cannot: a Dockerfile that copies a file to one path while the server looks in another is valid in isolation and broken in combination. Only running the container reveals it.

Both images copied only their entrypoint — server.js / server.py — without the
modules those files import, so neither could start. Nothing in the repository
references them, so the published Go image is unaffected.

Each image now copies every module its server imports, and the layout inside the
image mirrors the repository, keeping server-node/ and client/ as siblings so the
widget resolves at ../client/fcaptcha.js with no configuration. Both are
therefore built from the repository root:

  docker build -f server-node/Dockerfile -t fcaptcha-node .

Python keeps `python server.py` rather than a bare uvicorn invocation, because
the __main__ block sets proxy_headers=False, which FCaptcha requires so that
TRUSTED_PROXIES is the only thing resolving a client address.

Verified by running each container: both serve /health, /fcaptcha.js and
/api/pow/challenge, and the end-to-end suite against each matches what that
server scores natively (Node 93/93, Python 80/93, the latter being the
implementation's documented divergences rather than anything the image adds).

docker-smoke now covers all three images. Startup, the widget endpoint, the
challenge endpoint and the startup log are checked for each; the demo-page
assertion stays specific to the published image. These are packaging checks and
they cover a gap unit tests cannot: a Dockerfile that copies a file to one path
while the server looks in another is valid in isolation and broken in
combination, and only running the container reveals it.

Also simplifies a comment in resolveClientPath to state the coupling between the
candidate list and the Dockerfiles rather than recount how it was found.
@cport1
cport1 force-pushed the fix/node-python-dockerfiles branch from edbfab6 to 3d22a42 Compare July 28, 2026 14:23
@cport1 cport1 changed the title fix(docker): make the Node and Python images start at all fix(docker): complete the Node and Python image builds Jul 28, 2026
@cport1
cport1 merged commit b5854ce into main Jul 28, 2026
4 checks passed
@cport1
cport1 deleted the fix/node-python-dockerfiles branch July 28, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant