From b2b3c4ef0a6d6e049b6dd90877ca3802fed681b2 Mon Sep 17 00:00:00 2001 From: Siwa12100 Date: Sun, 10 Mar 2024 15:05:42 +0100 Subject: [PATCH] premiere version pour le deploiement --- VeraxShield/.dockerignore | 30 +++++++++++++++++++ VeraxShield/Dockerfile | 24 +++++++++++++++ VeraxShield/VeraxShield.csproj | 25 ++++++++++++++++ VeraxShield/VeraxShield/Dockerfile | 24 +++++++++++++++ .../Properties/launchSettings.json | 10 +++++++ VeraxShield/VeraxShield/VeraxShield.csproj | 3 ++ 6 files changed, 116 insertions(+) create mode 100644 VeraxShield/.dockerignore create mode 100644 VeraxShield/Dockerfile create mode 100644 VeraxShield/VeraxShield.csproj create mode 100644 VeraxShield/VeraxShield/Dockerfile diff --git a/VeraxShield/.dockerignore b/VeraxShield/.dockerignore new file mode 100644 index 0000000..4d72b4f --- /dev/null +++ b/VeraxShield/.dockerignore @@ -0,0 +1,30 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md +!**/.gitignore +!.git/HEAD +!.git/config +!.git/packed-refs +!.git/refs/heads/** \ No newline at end of file diff --git a/VeraxShield/Dockerfile b/VeraxShield/Dockerfile new file mode 100644 index 0000000..5fb0663 --- /dev/null +++ b/VeraxShield/Dockerfile @@ -0,0 +1,24 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["VeraxShield/VeraxShield.csproj", "VeraxShield/"] +RUN dotnet restore "./VeraxShield/VeraxShield.csproj" +COPY . . +WORKDIR "/src/VeraxShield" +RUN dotnet build "./VeraxShield.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./VeraxShield.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "VeraxShield.dll"] \ No newline at end of file diff --git a/VeraxShield/VeraxShield.csproj b/VeraxShield/VeraxShield.csproj new file mode 100644 index 0000000..19ef556 --- /dev/null +++ b/VeraxShield/VeraxShield.csproj @@ -0,0 +1,25 @@ + + + + net7.0 + enable + enable + db90e7c7-2fe7-4678-b9a3-95a1758ccd99 + Linux + + + + <_ContentIncludedByDefault Remove="wwwroot\data\fakeUtilisateurs.json" /> + + + + + + + + + + + + + diff --git a/VeraxShield/VeraxShield/Dockerfile b/VeraxShield/VeraxShield/Dockerfile new file mode 100644 index 0000000..5fb0663 --- /dev/null +++ b/VeraxShield/VeraxShield/Dockerfile @@ -0,0 +1,24 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["VeraxShield/VeraxShield.csproj", "VeraxShield/"] +RUN dotnet restore "./VeraxShield/VeraxShield.csproj" +COPY . . +WORKDIR "/src/VeraxShield" +RUN dotnet build "./VeraxShield.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./VeraxShield.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "VeraxShield.dll"] \ No newline at end of file diff --git a/VeraxShield/VeraxShield/Properties/launchSettings.json b/VeraxShield/VeraxShield/Properties/launchSettings.json index 1b433a7..3e6fa70 100644 --- a/VeraxShield/VeraxShield/Properties/launchSettings.json +++ b/VeraxShield/VeraxShield/Properties/launchSettings.json @@ -34,6 +34,16 @@ "ASPNETCORE_URLS": "https://localhost:7112;http://localhost:5272" }, "distributionName": "" + }, + "Container (Dockerfile)": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "environmentVariables": { + "ASPNETCORE_URLS": "https://+:443;http://+:80" + }, + "publishAllPorts": true, + "useSSL": true } }, "iisSettings": { diff --git a/VeraxShield/VeraxShield/VeraxShield.csproj b/VeraxShield/VeraxShield/VeraxShield.csproj index 126f5a2..19ef556 100644 --- a/VeraxShield/VeraxShield/VeraxShield.csproj +++ b/VeraxShield/VeraxShield/VeraxShield.csproj @@ -4,6 +4,8 @@ net7.0 enable enable + db90e7c7-2fe7-4678-b9a3-95a1758ccd99 + Linux @@ -17,6 +19,7 @@ +