GitIgnore fixes, DockerFile fixes

This commit is contained in:
Jānis Kacēns
2024-10-07 22:44:45 +03:00
parent 3889e684b4
commit 095e6baff3
60 changed files with 1236 additions and 436 deletions
+25 -16
View File
@@ -1,20 +1,29 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /build
# Stage 1: Build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
# Copy the project file and restore dependencies
COPY PosterMaker.Core.csproj .
RUN dotnet restore PosterMaker.Core.csproj
# Copy the entire source code and build it
COPY . .
RUN dotnet build PosterMaker.Core.csproj -c Release -o /app/build
# Stage 2: Publish
FROM build AS publish
RUN dotnet publish PosterMaker.Core.csproj -c Release -o /app/publish
# Stage 3: Final
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS final
WORKDIR /app
# Set environment variables and expose port
ENV ASPNETCORE_URLS=http://+:80
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["PosterMaker.Core/PosterMaker.Core.csproj", "PosterMaker.Core/"]
RUN dotnet restore "PosterMaker.Core/PosterMaker.Core.csproj"
COPY . .
WORKDIR "/src/PosterMaker.Core"
RUN dotnet build "PosterMaker.Core.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "PosterMaker.Core.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
# Copy the published app from the publish stage
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "PosterMaker.Core.dll"]
# Set the entrypoint
ENTRYPOINT ["dotnet", "PosterMaker.Core.dll"]