Refactor Dockerfile for managing API development
- Simplified Dockerfile by removing redundant build step and adjusting COPY command for clarity. - Updated publish command to include --no-restore for efficiency during the build process.
This commit is contained in:
@@ -23,15 +23,12 @@ COPY ["/src/Managing.Infrastructure.Web3/Managing.Infrastructure.Evm.csproj", "s
|
||||
# Restore dependencies for all projects
|
||||
RUN dotnet restore "/buildapp/src/Managing.Api/Managing.Api.csproj"
|
||||
|
||||
# Copy everything else and build
|
||||
# Copy everything else
|
||||
COPY . .
|
||||
|
||||
WORKDIR "/buildapp/src/Managing.Api"
|
||||
RUN dotnet build "Managing.Api.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
WORKDIR "/buildapp/src/Managing.Api"
|
||||
RUN dotnet publish "Managing.Api.csproj" -c Release -o /app/publish
|
||||
RUN dotnet publish "Managing.Api.csproj" -c Release -o /app/publish --no-restore
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
|
||||
Reference in New Issue
Block a user