Files
MeterVault/deploy/Dockerfile
T
schmidt.florian fe3d81b192 Deploy: change default HTTP port 8080 -> 8760
8080 is a very common, collision-prone port. 8760 (hours in a year) is an uncommon default that also avoids Home Assistant's 8123. Applied across Dockerfile (ASPNETCORE_URLS/EXPOSE), compose (mapping + healthcheck), the Unraid template, README and a code comment. The METERVAULT_PORT host override still works.

Claude-Session: https://claude.ai/code/session_01Kib2MniVFbD95fkgLgBBnB
2026-07-17 11:05:01 +02:00

33 lines
1.4 KiB
Docker

# syntax=docker/dockerfile:1
# Build context is the repository root (see docker-compose.yml: context: ..).
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
# Restore first (layer-cached on lockfile-ish inputs).
COPY Directory.Build.props Directory.Packages.props global.json ./
COPY src/Core/MeterVault.Core.csproj src/Core/
COPY src/Infrastructure/MeterVault.Infrastructure.csproj src/Infrastructure/
COPY src/App/MeterVault.App.csproj src/App/
RUN dotnet restore src/App/MeterVault.App.csproj
# Build & publish. sampledata/ must be present so the App csproj's linked Content glob
# (..\..\sampledata\*.csv) resolves at publish time — otherwise "Load reference data" ships empty.
COPY src/ ./src/
COPY sampledata/ ./sampledata/
RUN dotnet publish src/App/MeterVault.App.csproj -c Release -o /app/publish /p:UseAppHost=false
# Debian-based runtime (keeps full ICU — required by the de-DE CSV importer; do not use
# an invariant-globalization or chiselled image that strips ICU).
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /app/publish ./
ENV ASPNETCORE_URLS=http://+:8760 \
ASPNETCORE_ENVIRONMENT=Production \
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
EXPOSE 8760
ENTRYPOINT ["dotnet", "MeterVault.App.dll"]