From 2f551f4d4af20208559b35bc26448a93433b1545 Mon Sep 17 00:00:00 2001 From: Alex Hyett Date: Wed, 27 Sep 2023 09:21:41 +0100 Subject: [PATCH] Add docker files --- Dockerfile | 20 ++++++++++++++++++++ docker-compose.yml | 7 +++++++ 2 files changed, 27 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..932e305 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +WORKDIR /app + +COPY src/*.csproj ./ + +WORKDIR /app +RUN dotnet restore + +WORKDIR /app +COPY src/. ./ +WORKDIR /app +RUN dotnet publish -c Release -o out + +FROM mcr.microsoft.com/dotnet/aspnet:7.0 +WORKDIR /app +EXPOSE 5157/tcp +ENV ASPNETCORE_URLS http://*:5157 + +COPY --from=build /app/out ./ +ENTRYPOINT ["dotnet", "Age.dll"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..57ba344 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: '3.8' + +services: + api: + build: . + ports: + - 5157:5157 \ No newline at end of file