File tree Expand file tree Collapse file tree 1 file changed +12
-17
lines changed
Expand file tree Collapse file tree 1 file changed +12
-17
lines changed Original file line number Diff line number Diff line change 1- FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
1+ # syntax=docker/dockerfile:1
2+
3+ ARG DOTNET_VERSION=10.0
4+
5+ FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS build
26WORKDIR /src
37
4- # Copy csproj and restore as distinct layers
5- COPY ["OpenBioCardServer.csproj" , "./" ]
6- RUN dotnet restore "OpenBioCardServer.csproj"
8+ COPY OpenBioCardServer/OpenBioCardServer.csproj OpenBioCardServer/
9+ RUN dotnet restore OpenBioCardServer/OpenBioCardServer.csproj
710
8- # Copy everything else and build
911COPY . .
10- RUN dotnet publish "OpenBioCardServer.csproj" -c Release -o /app/publish /p:UseAppHost=false
12+ RUN dotnet publish OpenBioCardServer/OpenBioCardServer.csproj \
13+ -c Release -o /app/publish /p:UseAppHost=false
1114
12- FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
15+ FROM mcr.microsoft.com/dotnet/aspnet:${DOTNET_VERSION} AS runtime
1316WORKDIR /app
1417
15- # Create a non-root user for security (optional but recommended)
16- # .NET 8 images already include a non-root user 'app', but we stick to default for simplicity
17- # unless specific permission requirements exist.
18-
19- COPY --from=build /app/publish .
20-
21- # .NET 8 container images listen on port 8080 by default
22- EXPOSE 8080
23-
24- # Environment variables can be overridden in docker-compose or run command
2518ENV ASPNETCORE_URLS=http://+:8080
19+ EXPOSE 8080
2620
21+ COPY --from=build /app/publish .
2722ENTRYPOINT ["dotnet" , "OpenBioCardServer.dll" ]
You can’t perform that action at this time.
0 commit comments