deploiement 5
continuous-integration/drone/push Build is failing Details

pull/29/head
Maxime ROCHER 3 months ago
parent d11ce9cbc9
commit 0ba0670270

@ -79,7 +79,8 @@ steps:
OVERWRITE: true OVERWRITE: true
ADMINS: maximerocher,kevinmondejar,lenibeaulaton,kentinbrongniart,tommynguyen ADMINS: maximerocher,kevinmondejar,lenibeaulaton,kentinbrongniart,tommynguyen
commands: commands:
- dotnet /app/WF-WebAdmin.dll - ls /app # Vérification que WF-WebAdmin.dll est bien présent
- dotnet WF-WebAdmin.dll
when: when:
branch: branch:
- master - master

@ -1,22 +1,31 @@
# Étape 1 : Build de l'application # Étape 1 : Image de base ASP.NET pour le runtime
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
# Étape 2 : Build de l'application avec le SDK .NET
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src WORKDIR /src
# Copier les fichiers de projet et restaurer les dépendances # Copier le fichier .csproj et restaurer les dépendances
COPY WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj ./WF-WebAdmin/WF-WebAdmin/ COPY ["WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj", "./"]
RUN dotnet restore ./WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj RUN dotnet restore "WF-WebAdmin.csproj"
# Copier tout le reste et publier # Copier tout le reste des fichiers sources
COPY . . COPY . .
RUN dotnet publish ./WF-WebAdmin/WF-WebAdmin/WF-WebAdmin.csproj -c Release -o /app
# Étape 2 : Image runtime # Compiler le projet
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime RUN dotnet build "WF-WebAdmin.csproj" -c Release -o /app/build
WORKDIR /app
COPY --from=build /app .
# Exposer le port utilisé par l'application # Étape 3 : Publication de l'application
EXPOSE 5000 FROM build AS publish
RUN dotnet publish "WF-WebAdmin.csproj" -c Release -o /app/publish
# Étape 4 : Préparer l'image finale pour exécution
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
# Lancer l'application # Lancer l'application
ENTRYPOINT ["dotnet", "WF-WebAdmin.dll"] ENTRYPOINT ["dotnet", "WF-WebAdmin.dll"]

Loading…
Cancel
Save