Add support for running as docker container

This commit is contained in:
2023-07-23 21:12:50 +01:00
parent 967c16b6bf
commit b32ac7ba6f
4 changed files with 33 additions and 9 deletions

14
Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build
WORKDIR /src
COPY . ./
WORKDIR Groceries
RUN dotnet restore
RUN dotnet publish --no-restore --output /out
FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine AS base
WORKDIR /groceries
COPY --from=build /out .
COPY --from=build /src/Groceries/config.ini /config/
VOLUME /config
ENV DOTNET_ENABLEDIAGNOSTICS=0
ENTRYPOINT ["./Groceries", "--data", "/config"]