Files
Trainpulse/Dockerfile
T
Claude 30d3127b21 Auf Docker umgestellt
Ein Image (pfaedle + pmtiles + Python), zwei Container per compose:
web (Port 8080) und updater (stündlich Fahrplan, beim ersten Start
Kartenkacheln). install.sh installiert Docker und startet alles.
systemd-Dienste entfernt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X48pE4bzjHej8w9HyZXCjb
2026-10-21 19:24:44 +02:00

29 lines
1.2 KiB
Docker

# pfaedle: rechnet aus OpenStreetMap die echten Streckenverläufe
FROM debian:trixie AS pfaedle
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates git cmake g++ make libzip-dev zlib1g-dev libbz2-dev \
&& git clone --depth 1 --recurse-submodules --shallow-submodules https://github.com/ad-freiburg/pfaedle /src \
&& cmake -S /src -B /build -DCMAKE_BUILD_TYPE=Release \
&& make -C /build -j"$(nproc)" pfaedle \
&& make -C /build install
# pmtiles: schneidet die Kartenkacheln für die Region aus
FROM golang:1.25-trixie AS pmtiles
RUN go install github.com/protomaps/go-pmtiles@v1.31.2
FROM python:3.13-slim-trixie
RUN apt-get update && apt-get install -y --no-install-recommends libzip5 zlib1g libbz2-1.0 libgomp1 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=pfaedle /usr/local/bin/pfaedle /usr/local/bin/
COPY --from=pfaedle /usr/local/etc/pfaedle /usr/local/etc/pfaedle
COPY --from=pmtiles /go/bin/go-pmtiles /usr/local/bin/pmtiles
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY trainpulse trainpulse
COPY web web
COPY tests tests
ENV TRAINPULSE_DATA=/data PYTHONUNBUFFERED=1
EXPOSE 8080
CMD ["uvicorn", "trainpulse.server:app", "--host", "0.0.0.0", "--port", "8080", "--proxy-headers"]