feat(web): fill browser window and fix localhost loading

Use a custom pygbag template: canvas uses the full window (gui_divider 1),
black page background, and redirect localhost to 127.0.0.1 because the
pygbag runtime otherwise fetches pygame from a local :8000 dev proxy and
the game never starts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-27 23:11:40 +02:00
co-authored by Claude Opus 5.5
parent e70ee0a01d
commit 97348f884a
3 changed files with 449 additions and 2 deletions
+3 -1
View File
@@ -4,9 +4,11 @@ RUN pip install --no-cache-dir pygbag==0.9.3
COPY main.py ./
COPY src/ ./src/
COPY assets/ ./assets/
# Full-window canvas template; kept outside /app so it is not packed into the game.
COPY web/pygbag.tmpl /pygbag.tmpl
# Do not publish the desktop leaderboard or developer files.
RUN printf '[]\n' > src/highscore.json \
&& python -m pygbag --build --no_opt --disable-sound-format-error --title "Silent FH" .
&& python -m pygbag --build --no_opt --disable-sound-format-error --title "Silent FH" --template /pygbag.tmpl .
FROM nginxinc/nginx-unprivileged:1.28-alpine
COPY --from=build /app/build/web/ /usr/share/nginx/html/