GitIgnore fixes, DockerFile fixes
This commit is contained in:
+25
-16
@@ -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"]
|
||||
Reference in New Issue
Block a user