New stuff

This commit is contained in:
Elias Jansson
2025-02-24 15:43:47 +01:00
parent 36429beada
commit 4635724569
22 changed files with 1493 additions and 294 deletions

View File

@@ -1,27 +1,33 @@
# Base image for runtime
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
# Leave the ports exposed to allow Unraid to configure them
EXPOSE 80 443
# Image for building the project
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
# Copy the .csproj and restore dependencies
COPY ["Aberwyn.csproj", "./"]
RUN dotnet restore "Aberwyn.csproj"
COPY Aberwyn.csproj ./
RUN dotnet restore
# Copy everything else and build the app
COPY . .
RUN dotnet build "Aberwyn.csproj" -c Release -o /app/build
RUN dotnet build Aberwyn.csproj -c Release -o /app/build
# Publish the app to the /app/publish folder
FROM build AS publish
RUN dotnet publish "Aberwyn.csproj" -c Release -o /app/publish
RUN dotnet publish Aberwyn.csproj -c Release -o /app/publish
# Use the base runtime image to run the app
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
# Use environment variable for ports to allow flexibility
ENV ASPNETCORE_URLS="http://+:80"
# Set entry point to start the application
ENTRYPOINT ["dotnet", "Aberwyn.dll"]