GitIgnore fixes, DockerFile fixes
This commit is contained in:
+31
-14
@@ -1,27 +1,44 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 44404
|
||||
ENV ASPNETCORE_URLS=http://*:44404
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
# Copy the certificate
|
||||
COPY aspnetcore.pfx /https/aspnetcore.pfx
|
||||
RUN ls /https && ls /https/aspnetcore.pfx && echo "Certificate copied successfully."
|
||||
ENV ASPNETCORE_URLS=https://+;http://+
|
||||
ENV ASPNETCORE_HTTPS_PORT=443
|
||||
ENV ASPNETCORE_Kestrel__Certificates__Default__Password=test
|
||||
ENV ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetcore.pfx
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
# Install Node.js
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash - \
|
||||
&& apt-get install -y \
|
||||
nodejs \
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
||||
&& apt-get install -y nodejs \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /src
|
||||
COPY ["PosterMaker.UI/PosterMaker.UI.csproj", "PosterMaker.UI/"]
|
||||
RUN dotnet restore "PosterMaker.UI/PosterMaker.UI.csproj"
|
||||
COPY PosterMaker.UI.csproj .
|
||||
RUN dotnet restore PosterMaker.UI.csproj
|
||||
COPY . .
|
||||
WORKDIR "/src/PosterMaker.UI"
|
||||
RUN dotnet build "PosterMaker.UI.csproj" -c Release -o /app/build
|
||||
|
||||
# Build Angular app
|
||||
WORKDIR "/src/ClientApp"
|
||||
RUN npm install
|
||||
RUN npm run build --prod
|
||||
|
||||
# Build .NET app
|
||||
WORKDIR "/src"
|
||||
RUN dotnet build PosterMaker.UI.csproj -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "PosterMaker.UI.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
RUN dotnet publish PosterMaker.UI.csproj -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "PosterMaker.UI.dll"]
|
||||
|
||||
# Copy Angular build output to wwwroot
|
||||
COPY --from=build /src/ClientApp/dist /app/wwwroot
|
||||
|
||||
# Ensure SpaProxy properly configured
|
||||
ENTRYPOINT ["dotnet", "PosterMaker.UI.dll"]
|
||||
Reference in New Issue
Block a user