Add Docker

This commit is contained in:
2021-01-30 01:17:37 +00:00
parent 37e5c0796e
commit 46ecfda134
6 changed files with 75 additions and 0 deletions

25
src/.dockerignore Normal file
View File

@@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md

16
src/RestAPI/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
WORKDIR /app
COPY ["src/RestAPI/RestAPI.csproj", "src/RestAPI/"]
RUN dotnet restore "src/RestAPI/RestAPI.csproj"
COPY . .
WORKDIR ./src/RestAPI
RUN dotnet build "RestAPI.csproj" -c Release -o /app/build
RUN dotnet publish "RestAPI.csproj" -c Release -o /app/publish
FROM mcr.microsoft.com/dotnet/aspnet:5.0
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "RestAPI.dll"]