-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (21 loc) · 711 Bytes
/
Dockerfile
File metadata and controls
28 lines (21 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
# Copy csproj and restore dependencies
COPY ["FritzApp/FritzApp.csproj", "FritzApp/"]
RUN dotnet restore "FritzApp/FritzApp.csproj"
# Copy everything else and build
COPY . .
WORKDIR "/src/FritzApp"
RUN dotnet build "FritzApp.csproj" -c Release -o /app/build
# Publish stage
FROM build AS publish
RUN dotnet publish "FritzApp.csproj" -c Release -o /app/publish
# Runtime stage - serve with nginx
FROM nginx:alpine AS final
WORKDIR /usr/share/nginx/html
# Copy published output to nginx html directory
COPY --from=publish /app/publish/wwwroot .
# Copy nginx configuration
COPY FritzApp/nginx.config /etc/nginx/nginx.conf
EXPOSE 80