SmartestHome/transit/Dockerfile

18 lines
578 B
Docker

# transit — one image, two entrypoints: the always-on departures API (server.py,
# the default CMD) and the weekly GTFS refresh (sync_gtfs.py, run via
# `docker compose run --rm transit-sync` from a systemd timer, same two-entrypoint-
# one-image shape as nothing else in this repo needs, but the straightforward one).
FROM python:3.11-slim
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
WORKDIR /app
# stdlib only (csv, zipfile, sqlite3, http.server, urllib) — no requirements.txt.
COPY server.py sync_gtfs.py ./
RUN mkdir -p /data
CMD ["python", "server.py"]