aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerghei Cebotari <serghei@cebotari.ru>2023-11-14 14:14:42 +0300
committerSerghei Cebotari <serghei@cebotari.ru>2023-11-14 14:14:42 +0300
commit8035577277e299c9d26afdf8e49c2316055fd800 (patch)
tree5a9d7ee4c07756d3a455aba8614515afa91a5ff7
parent4857c066300255312d1e1736f2a03c256c6a9501 (diff)
Add Docker supportHEADmaster
-rw-r--r--Dockerfile12
-rw-r--r--MindBoxApi.sln2
2 files changed, 13 insertions, 1 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..8d0f9c8
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,12 @@
+FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
+WORKDIR /app
+COPY . ./
+RUN dotnet restore
+RUN dotnet publish -c Release -o out
+
+FROM mcr.microsoft.com/dotnet/aspnet:7.0
+EXPOSE 5000
+WORKDIR /app
+COPY --from=build /app/out .
+ENV ASPNETCORE_ENVIRONMENT Production
+ENTRYPOINT [ "dotnet", "MindBoxApi.dll", "--urls=http://0.0.0.0:5000" ] \ No newline at end of file
diff --git a/MindBoxApi.sln b/MindBoxApi.sln
index ed8e37e..70967cf 100644
--- a/MindBoxApi.sln
+++ b/MindBoxApi.sln
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MindBoxApi", "MindboxApi\MindBoxApi.csproj", "{C94FA5F5-6E7A-4415-9C5B-51A5EF52408F}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MindBoxApi", "MindBoxApi\MindBoxApi.csproj", "{C94FA5F5-6E7A-4415-9C5B-51A5EF52408F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution