Skip to content

Commit

Permalink
fix(Dockerfile): new Env var added
Browse files Browse the repository at this point in the history
  • Loading branch information
aliyaghini committed Aug 14, 2024
1 parent 1b923f5 commit a37e39b
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
FROM mcr.microsoft.com/dotnet/sdk:latest AS build-env
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /app
EXPOSE 80
EXPOSE 443
# Copy the csproj and restore all of the nugets
COPY . ./
RUN dotnet restore ./AnalysisData/AnalysisData.sln
# Copy everything else and build
#COPY . ./
RUN dotnet publish -c Release -o out ./AnalysisData/AnalysisData.sln
# Build runtime image
FROM mcr.microsoft.com/dotnet/sdk:latest

COPY ./AnalysisData/ ./
RUN dotnet restore
COPY . .

RUN dotnet publish ./AnalysisData/AnalysisData/AnalysisData.csproj -c Release -o out

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "AnalysisData.dll"]
COPY --from=build /app/out ./

ENV ASPNETCORE_ENVIRONMENT=Development
#ENV ConnectionStrings__DefaultConnection=Host=db;Database=YourDatabaseName;Username=yourusername;Password=yourpassword
ENV ASPNETCORE_URLS=http://*:80
EXPOSE 80


# Start the application
ENTRYPOINT ["dotnet", "AnalysisData.dll"]

0 comments on commit a37e39b

Please sign in to comment.