chore(docker): add dockerfile and docker compose files

also add a `docker` scope to CONTRIBUTING.md
This commit is contained in:
cswimr 2024-12-31 19:11:36 -05:00
parent 075261de59
commit 21ad7f208a
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087
4 changed files with 94 additions and 0 deletions

23
Dockerfile Normal file
View file

@ -0,0 +1,23 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["ZenithInfo.csproj", "./"]
RUN dotnet restore "ZenithInfo.csproj"
COPY . .
WORKDIR "/src/"
RUN dotnet build "ZenithInfo.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "ZenithInfo.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ZenithInfo.dll"]