Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
|
92702e88fc | 1 year ago |
|
38c5130d26 | 1 year ago |
@ -1,20 +1,17 @@
|
|||||||
# Utiliser l'image SDK .NET pour construire l'application
|
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
WORKDIR /Sources/HeartTrack
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Copier les fichiers du projet et restaurer les dépendances
|
|
||||||
COPY *.csproj .
|
|
||||||
RUN dotnet restore
|
|
||||||
|
|
||||||
# Copier tout le reste et construire l'application
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN dotnet publish -c Release -o out
|
|
||||||
|
|
||||||
# Utiliser l'image runtime .NET pour exécuter l'application
|
WORKDIR /Sources/HeartTrack
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime
|
ARG BUILD_CONFIGURATION=Release
|
||||||
|
RUN dotnet publish "HeartTrack.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
|
||||||
|
USER $APP_UID
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build /app/out .
|
|
||||||
|
COPY --from=build /app/publish .
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
ENTRYPOINT ["dotnet", "HeartTrack.dll"]
|
ENTRYPOINT ["dotnet", "HeartTrackAPI.dll"]
|
Loading…
Reference in new issue