Skip to content

Commit fd2509e

Browse files
feat: update Dockerfile and .dockerignore for simplified project structure and improved build process
1 parent b995e0f commit fd2509e

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

Applications/Proxy/.dockerignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
**/.vscode
77
**/TestResults
88

9-
**/appsettings.json
109
**/appsettings.Development.json
11-
**/appsettings.*.json
1210

1311
.env
1412
.env.*

Applications/Proxy/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ ARG BUILD_CONFIGURATION=Release
1111
ARG SOLUTION=HttpsRichardy.Federation.Proxy
1212

1313
# copy only csproj and sln to restore as early as possible
14-
COPY ["Source/${SOLUTION}.WebApi/${SOLUTION}.WebApi.csproj", "${SOLUTION}.WebApi/"]
14+
COPY ["Source/${SOLUTION}.csproj", "Source/"]
1515
COPY ["${SOLUTION}.sln", "./"]
1616

1717
# restore dependencies
18-
RUN dotnet restore "${SOLUTION}.WebApi/${SOLUTION}.WebApi.csproj"
18+
RUN dotnet restore "Source/${SOLUTION}.csproj"
1919

2020
# copy the rest of the source code
2121
COPY Source/ ./Source/
2222

23-
WORKDIR "/workdir/Source/${SOLUTION}.WebApi"
23+
WORKDIR "/workdir/Source"
2424

2525
# build in Release mode
26-
RUN dotnet build "${SOLUTION}.WebApi.csproj" -c $BUILD_CONFIGURATION -o /artifacts/build
26+
RUN dotnet build "${SOLUTION}.csproj" -c $BUILD_CONFIGURATION -o /artifacts/build
2727

2828
# publish the project for production
29-
RUN dotnet publish "${SOLUTION}.WebApi.csproj" -c $BUILD_CONFIGURATION -o /artifacts/publish /p:UseAppHost=false
29+
RUN dotnet publish "${SOLUTION}.csproj" -c $BUILD_CONFIGURATION -o /artifacts/publish /p:UseAppHost=false
3030

3131
# final image to run the app
3232
FROM base AS final
@@ -39,4 +39,4 @@ ENV DOTNET_RUNNING_IN_CONTAINER=true
3939
# copy published files from the build stage
4040
COPY --from=build /artifacts/publish .
4141

42-
ENTRYPOINT ["dotnet", "HttpsRichardy.Federation.Proxy.WebApi.dll"]
42+
ENTRYPOINT ["dotnet", "HttpsRichardy.Federation.Proxy.dll"]

0 commit comments

Comments
 (0)