Add web/ — PTY+WebSocket server, xterm.js PWA client, Dockerfile, and PyInstaller notes

This commit is contained in:
KansaiGaijin
2026-07-07 13:21:45 +12:00
parent dee742b1e4
commit 262292228e
11 changed files with 283 additions and 0 deletions

25
web/Dockerfile Normal file
View File

@@ -0,0 +1,25 @@
FROM python:3.12-slim AS base
WORKDIR /app
# Install server dependencies
COPY web/requirements.txt /tmp/
RUN pip install --no-cache-dir -r /tmp/requirements.txt
# ----------
FROM base AS builder
COPY web/static/generate_icons.py /tmp/
RUN python /tmp/generate_icons.py && mv icon-*.png /tmp/
# ----------
FROM base AS runner
# Game source
COPY main.py player.py scene.py function_list.py class_list.py race_list.py enum_list.py spell_list.py ./
# Web server
COPY web/server.py ./web/server.py
COPY web/static/index.html web/static/manifest.json web/static/sw.js ./web/static/
COPY --from=builder /tmp/icon-192.png /tmp/icon-512.png ./web/static/
EXPOSE 8080
CMD ["uvicorn", "web.server:app", "--host", "0.0.0.0", "--port", "8080"]