27 lines
761 B
Docker
27 lines
761 B
Docker
FROM mcr.microsoft.com/dotnet/runtime:10.0 AS base
|
|
|
|
# Install timezone data so .NET can resolve local time zones
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends tzdata \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
USER 1000
|
|
WORKDIR /app
|
|
|
|
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
|
ARG BUILD_CONFIGURATION=Release
|
|
WORKDIR /src
|
|
COPY ["FtpThing.csproj", "./"]
|
|
RUN dotnet restore "FtpThing.csproj"
|
|
COPY . .
|
|
RUN dotnet build "./FtpThing.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
|
|
|
FROM build AS publish
|
|
ARG BUILD_CONFIGURATION=Release
|
|
RUN dotnet publish "./FtpThing.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
|
|
|
FROM base AS final
|
|
WORKDIR /app
|
|
COPY --from=publish /app/publish .
|
|
ENTRYPOINT ["dotnet", "FtpThing.dll"]
|