Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Web / PUSG.Web / Dockerfile
diff options
context:
space:
mode:
1 files changed, 22 insertions, 0 deletions
-rw-r--r--src/Web/PUSG.Web/Dockerfile22
diff --git a/src/Web/PUSG.Web/Dockerfile b/src/Web/PUSG.Web/Dockerfile
new file mode 100644
index 0000000..4c19158
--- /dev/null
+++ b/src/Web/PUSG.Web/Dockerfile
@@ -0,0 +1,22 @@
+FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
+WORKDIR /app
+
+# Copy csproj and restore as distinct layers
+COPY *.csproj ./
+RUN dotnet restore
+
+# Copy everything else and build
+COPY . .
+RUN dotnet publish -c Release -o out
+
+# Build runtime image
+FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
+WORKDIR /app
+COPY --from=build-env /app/out .
+
+# Run the app on container startup
+# Use your project name for the second parameter
+# e.g. MyProject.dll
+ENTRYPOINT [ "dotnet", "PUSG.Web.dll" ]
+
+CMD ASPNETCORE_URLS=http://*:$PORT dotnet PUSG.Web.dll \ No newline at end of file