diff options
| author | godosa <godosa@godosa.eu> | 2026-10-07 00:14:38 +0200 |
|---|---|---|
| committer | godosa <godosa@godosa.eu> | 2026-10-07 00:14:38 +0200 |
| commit | 3443c1c65e9f1753e1e656b35d08416c1fa298f2 (patch) | |
| tree | 4e43236f460145a4d75d1b4616dcb7aa6ef08f51 /deploy/Containerfile | |
| download | worldmap-viewer-3443c1c65e9f1753e1e656b35d08416c1fa298f2.tar.gz worldmap-viewer-3443c1c65e9f1753e1e656b35d08416c1fa298f2.zip | |
worldmap-viewer: initial public history
Diffstat (limited to 'deploy/Containerfile')
| -rw-r--r-- | deploy/Containerfile | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/deploy/Containerfile b/deploy/Containerfile new file mode 100644 index 0000000..4e82eea --- /dev/null +++ b/deploy/Containerfile @@ -0,0 +1,27 @@ +# The map server for a public, read-only map. Build from the folder that holds worldgen/ and worldmap-viewer/: +# podman build -f worldmap-viewer/deploy/Containerfile -t worldmap-viewer . +# Code only: worlds (config/, places/, built out/) are mounted at run time — see deploy/README.md. +FROM docker.io/library/python:3.14-slim + +ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 \ + WORLDGEN=/app/worldgen NUMBA_CACHE_DIR=/var/cache/worldmap-viewer/numba \ + OPENBLAS_THREAD_TIMEOUT=4 \ + WORLDMAP_PUBLIC=1 WORLDMAP_BIND=0.0.0.0 WORLDMAP_PORT=8765 + +COPY worldmap-viewer/deploy/requirements.lock /app/requirements.lock +RUN pip install --no-cache-dir --root-user-action=ignore -r /app/requirements.lock + +COPY worldgen/mapgen /app/worldgen/mapgen +COPY worldmap-viewer/*.py worldmap-viewer/LICENSE worldmap-viewer/CREDITS.md worldmap-viewer/licenses.md /app/worldmap-viewer/ +COPY worldmap-viewer/viewer/index.html worldmap-viewer/viewer/style.css /app/worldmap-viewer/viewer/ +COPY worldmap-viewer/viewer/js /app/worldmap-viewer/viewer/js +COPY worldmap-viewer/viewer/vendor /app/worldmap-viewer/viewer/vendor + +RUN useradd --uid 8765 --no-create-home --home-dir /nonexistent worldmap-viewer \ + && mkdir -p /var/cache/worldmap-viewer/numba && chown -R worldmap-viewer /var/cache/worldmap-viewer +USER worldmap-viewer +WORKDIR /app/worldmap-viewer +EXPOSE 8765 +# health check (Quadlet: HealthCmd=; OCI images drop HEALTHCHECK): +# python -c "import os, urllib.request as u; u.urlopen('http://127.0.0.1:' + os.environ['WORLDMAP_PORT'] + '/api/worlds', timeout=8)" +ENTRYPOINT ["python", "serve.py"] |
