Initial commit carried over from private repo. This is V2.
This commit is contained in:
24
Dockerfile
Normal file
24
Dockerfile
Normal file
@ -0,0 +1,24 @@
|
||||
# Base image
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# Copy and restore with custom config
|
||||
COPY NuGet.config ./
|
||||
COPY Directory.Packages.props ./
|
||||
COPY code/ ./code/
|
||||
|
||||
WORKDIR /src/code/MessengerApi
|
||||
RUN dotnet restore MessengerApi.csproj
|
||||
|
||||
# Build and publish
|
||||
RUN dotnet publish MessengerApi.csproj -c Release -o /app/publish
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/publish .
|
||||
|
||||
ENTRYPOINT ["dotnet", "MessengerApi.dll"]
|
||||
Reference in New Issue
Block a user