-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (21 loc) · 879 Bytes
/
Dockerfile
File metadata and controls
27 lines (21 loc) · 879 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
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
# Copy solution, root build props, and all projects
COPY ZibStack.NET.slnx .
COPY Directory.Build.props .
COPY packages/ packages/
# shared/ holds DtoSemantics.cs which both Dto and TypeGen generators reference
# via <Compile Include="$(MSBuildProjectDirectory)\..\..\..\..\shared\DtoSemantics.cs">.
# Missing this directory caused publish to fail with CS2001 (file not found).
COPY shared/ shared/
# Restore
RUN dotnet restore packages/ZibStack.NET.UI/sample/SampleApi/SampleApi.csproj
# Build
RUN dotnet publish packages/ZibStack.NET.UI/sample/SampleApi/SampleApi.csproj -c Release -o /app
FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
COPY --from=build /app .
# Cloud Run sets PORT=8080; Render used 10000
ENV ASPNETCORE_URLS=http://+:${PORT:-8080}
EXPOSE 8080
ENTRYPOINT ["dotnet", "SampleApi.dll"]