From 200206c0cd8daaee1d78387b7805b420e86f72d9 Mon Sep 17 00:00:00 2001 From: michael-bailey Date: Wed, 19 Mar 2025 15:35:23 +0000 Subject: [PATCH] Added docker configuration --- .dockerignore | 25 +++++++++++++++++++ FileStorageService.www/Dockerfile | 23 +++++++++++++++++ .../FileStorageService.www.csproj | 7 ++++++ 3 files changed, 55 insertions(+) create mode 100644 .dockerignore create mode 100644 FileStorageService.www/Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..cd967fc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,25 @@ +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/.idea +**/*.*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 \ No newline at end of file diff --git a/FileStorageService.www/Dockerfile b/FileStorageService.www/Dockerfile new file mode 100644 index 0000000..baf42c6 --- /dev/null +++ b/FileStorageService.www/Dockerfile @@ -0,0 +1,23 @@ +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base +USER $APP_UID +WORKDIR /app +EXPOSE 8080 +EXPOSE 8081 + +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["FileStorageService.www/FileStorageService.www.csproj", "FileStorageService.www/"] +RUN dotnet restore "FileStorageService.www/FileStorageService.www.csproj" +COPY . . +WORKDIR "/src/FileStorageService.www" +RUN dotnet build "FileStorageService.www.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "FileStorageService.www.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "FileStorageService.www.dll"] diff --git a/FileStorageService.www/FileStorageService.www.csproj b/FileStorageService.www/FileStorageService.www.csproj index 2459e37..ab9ae2c 100644 --- a/FileStorageService.www/FileStorageService.www.csproj +++ b/FileStorageService.www/FileStorageService.www.csproj @@ -5,6 +5,7 @@ enable enable aspnet-FileStorageService.www-4664b1ed-c59b-4ce9-9b74-cc885df5d2f1 + Linux @@ -17,4 +18,10 @@ + + + .dockerignore + + +