-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (23 loc) · 779 Bytes
/
Dockerfile
File metadata and controls
32 lines (23 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Use the official .NET 9.0 runtime image
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
WORKDIR /app
# Use the .NET 9.0 SDK for building
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
# Copy the project file
COPY GassiMeter.csproj .
RUN dotnet restore "GassiMeter.csproj"
# Copy the source code
COPY . .
RUN dotnet build "GassiMeter.csproj" -c Release -o /app/build
# Publish the application
FROM build AS publish
RUN dotnet publish "GassiMeter.csproj" -c Release -o /app/publish /p:UseAppHost=false
# Final stage
FROM base AS final
WORKDIR /app
# Copy the published application
COPY --from=publish /app/publish .
ENV TZ=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENTRYPOINT ["dotnet", "GassiMeter.dll"]