OpenDataVisualizer/Dockerfile
Claudio Schaad bd2981ffb8 Add live weather layer from MeteoSwiss stations (#7)
- New Schaad.OpenData.Weather project: MeteoSwissClient reads the
  10-minute CSV of the five SwissMetNet stations in Thurgau every 10
  minutes (station list once a day) and backfills the last 7 days from
  the yearly file when the cache has less than 6 days
- History kept as JSON per day (60 days); a failing station does not
  stop the others
- API: /api/weather/meta, /stations (current values, 1 h/24 h rain,
  24 h min/max, strongest gust), /stations/{abbr}/history
- Combined map: "Wetter (live)" layer with station badges (temperature,
  24 h rain or wind), wind arrows, rain marker, station panel with
  hourly 7-day chart, overview and municipality context entries
- Docs: docs/datasets/wetter.md, overview in docs/datasets.md,
  CLAUDE.md; Docker and appsettings wiring

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claudio Schaad <c.schaad@pog.ch>
Co-committed-by: Claudio Schaad <c.schaad@pog.ch>
2026-11-19 05:04:46 +00:00

43 lines
2 KiB
Docker

# ---- Stage 1: build the React client into Schaad.OpenData.Server/wwwroot ----
FROM node:20-bookworm-slim AS build-client
WORKDIR /src/client
COPY client/package.json client/package-lock.json ./
RUN npm ci
COPY client/ ./
RUN npm run build
# ---- Stage 2: publish the ASP.NET Core server ----
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build-server
WORKDIR /src
COPY Directory.Build.props Directory.Packages.props ./
COPY Schaad.OpenData.Server/Schaad.OpenData.Server.csproj Schaad.OpenData.Server/
COPY Schaad.OpenData.Traffic/Schaad.OpenData.Traffic.csproj Schaad.OpenData.Traffic/
COPY Schaad.OpenData.Watercraft/Schaad.OpenData.Watercraft.csproj Schaad.OpenData.Watercraft/
COPY Schaad.OpenData.Vehicles/Schaad.OpenData.Vehicles.csproj Schaad.OpenData.Vehicles/
COPY Schaad.OpenData.Hydrology/Schaad.OpenData.Hydrology.csproj Schaad.OpenData.Hydrology/
COPY Schaad.OpenData.Weather/Schaad.OpenData.Weather.csproj Schaad.OpenData.Weather/
RUN dotnet restore Schaad.OpenData.Server/Schaad.OpenData.Server.csproj
COPY Schaad.OpenData.Server/ Schaad.OpenData.Server/
COPY Schaad.OpenData.Traffic/ Schaad.OpenData.Traffic/
COPY Schaad.OpenData.Watercraft/ Schaad.OpenData.Watercraft/
COPY Schaad.OpenData.Vehicles/ Schaad.OpenData.Vehicles/
COPY Schaad.OpenData.Hydrology/ Schaad.OpenData.Hydrology/
COPY Schaad.OpenData.Weather/ Schaad.OpenData.Weather/
COPY --from=build-client /src/Schaad.OpenData.Server/wwwroot Schaad.OpenData.Server/wwwroot
RUN dotnet publish Schaad.OpenData.Server/Schaad.OpenData.Server.csproj -c Release -o /app --no-restore
# ---- Stage 3: runtime ----
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app
COPY --from=build-server /app .
RUN mkdir -p /app/data && chown $APP_UID /app/data
USER $APP_UID
ENV ASPNETCORE_HTTP_PORTS=8080 \
Traffic__DataPath=/app/data \
Watercraft__DataPath=/app/data \
Vehicles__DataPath=/app/data \
Hydrology__DataPath=/app/data \
Weather__DataPath=/app/data
VOLUME /app/data
EXPOSE 8080
ENTRYPOINT ["dotnet", "Schaad.OpenData.Server.dll"]