Dockerize and automate
This commit is contained in:
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@ -0,0 +1,21 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
||||
WORKDIR /App
|
||||
|
||||
# Copy everything
|
||||
COPY . ./
|
||||
# Restore as distinct layers
|
||||
RUN dotnet restore
|
||||
# Build and publish a release
|
||||
RUN dotnet publish -c Release -o out
|
||||
|
||||
# Build runtime image
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS deploy
|
||||
WORKDIR /App
|
||||
COPY --from=build /App/out .
|
||||
|
||||
ENV DOTNET_EnableDiagnostics=0
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT ["dotnet", "/App/IO.Swagger.dll"]
|
||||
|
||||
Reference in New Issue
Block a user