Multi-stage Dockerfile (pyswisseph needs gcc), deploy notes

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
type-two 2026-09-15 10:44:36 +10:00
parent 77a522a16f
commit 11edf66af6
3 changed files with 23 additions and 2 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
__pycache__/ __pycache__/
*.pyc *.pyc
.DS_Store .DS_Store
.cf_token

View File

@ -1,7 +1,12 @@
FROM python:3.12-slim FROM python:3.12 AS build
WORKDIR /app WORKDIR /app
COPY requirements.txt . COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt gunicorn==23.0.0 RUN pip wheel --no-cache-dir --wheel-dir /wheels -r requirements.txt gunicorn==23.0.0
FROM python:3.12-slim
WORKDIR /app
COPY --from=build /wheels /wheels
RUN pip install --no-cache-dir --no-index --find-links=/wheels /wheels/*.whl && rm -rf /wheels
COPY . . COPY . .
EXPOSE 7799 EXPOSE 7799
# 2 workers is plenty: chart computation is a few ms; timezonefinder/geonames load per worker # 2 workers is plenty: chart computation is a few ms; timezonefinder/geonames load per worker

View File

@ -50,3 +50,18 @@ Open http://localhost:7799.
Ephemeris data files are from the official Swiss Ephemeris distribution (AGPL, Ephemeris data files are from the official Swiss Ephemeris distribution (AGPL,
astro.com / github.com/aloistr/swisseph). astro.com / github.com/aloistr/swisseph).
## Live deployment
Hosted at **https://stars.monsterrobot.games** — botchat/games VPS (`humanjing@100.71.119.27`),
container `nategodd` (gunicorn, bound to 127.0.0.1:7799), fronted by the existing cloudflared
tunnel (`~/.cloudflared/config.yml` ingress rule → `localhost:7799`; DNS = proxied CNAME to the
tunnel). Stateless: no DB, no per-user storage — saved charts live in each visitor's browser.
Redeploy after changes:
```bash
rsync -a --delete --exclude .venv --exclude .git --exclude __pycache__ ./ humanjing@100.71.119.27:nategodd/
ssh humanjing@100.71.119.27 'cd ~/nategodd && docker compose up -d --build'
curl -s -o /dev/null -w '%{http_code}\n' "https://stars.monsterrobot.games/?v=$(date +%s)"
```