Skip to content

Commit de84273

Browse files
committed
fix: Update Dockerfile to restore dependencies using project file instead of solution file
1 parent 2fda945 commit de84273

1 file changed

Lines changed: 1 addition & 20 deletions

File tree

quotes-analytics/Dockerfile

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,14 @@
1-
# Build stage
21
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
32
WORKDIR /src
4-
5-
# Copy solution and project files
6-
COPY quotes-analytics.sln .
73
COPY quotes-analytics.csproj .
8-
9-
# Restore dependencies
10-
RUN dotnet restore quotes-analytics.sln
11-
12-
# Copy source code (excluding tests via .dockerignore)
4+
RUN dotnet restore quotes-analytics.csproj
135
COPY . .
14-
15-
# Build and publish
166
RUN dotnet publish quotes-analytics.csproj -c Release -o /app/publish --no-restore
177

18-
# Runtime stage
198
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
209
WORKDIR /app
21-
22-
# Copy published app
2310
COPY --from=build /app/publish .
24-
25-
# Expose port
2611
EXPOSE 8081
27-
28-
# Set environment variables for OpenTelemetry
2912
ENV ASPNETCORE_URLS=http://+:8081
3013
ENV DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_HTTP2UNENCRYPTEDSUPPORT=true
31-
32-
# Run the application
3314
ENTRYPOINT ["dotnet", "quotes-analytics.dll"]

0 commit comments

Comments
 (0)