ci: Containerization of the app

This commit is contained in:
Blake Ridgway 2025-06-18 16:32:36 -05:00
parent ed25245a1c
commit 8597f48180
3 changed files with 99 additions and 8 deletions

34
Dockerfile Normal file
View file

@ -0,0 +1,34 @@
# RUN WITH docker run -e "ASPNETCORE_URLS=http://+:80" -p 8080:80 turf-tasker-app
# This is only temporary
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["turf_tasker.csproj", "./"]
RUN dotnet restore "turf_tasker.csproj"
COPY . .
WORKDIR "/src"
RUN dotnet build "turf_tasker.csproj" -c Release -o /app/build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS publish
WORKDIR /src
COPY --from=build "/src/turf_tasker.csproj" "./"
RUN dotnet restore "turf_tasker.csproj"
COPY . .
WORKDIR "/src"
RUN dotnet publish "turf_tasker.csproj" -c Release -o /app/publish /p:UserAppHost=false
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
WORKDIR /app
COPY --from=publish /app/publish .
COPY turf_tasker.db .
ENTRYPOINT ["dotnet", "turf_tasker.dll"]