-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdockerfile
More file actions
22 lines (18 loc) · 677 Bytes
/
Copy pathdockerfile
File metadata and controls
22 lines (18 loc) · 677 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM mcr.microsoft.com/dotnet/sdk:10.0-noble AS build-env
WORKDIR /app
RUN apt-get update && apt-get install -y g++ curl cmake
# Copy everything
COPY . ./
# Restore as distinct layers
RUN dotnet restore
# Build and publish a release
RUN dotnet publish ./src/Serval/src/Serval.ApiServer/Serval.ApiServer.csproj -c Release -o out_api_server
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:10.0-noble AS production
# libgomp needed for thot
RUN apt-get update && apt-get install -y libgomp1
WORKDIR /app
COPY --from=build-env /app/out_api_server ./api_server
RUN mkdir -p /app/api_server/SIL && chown $APP_UID:$APP_UID /app/api_server/SIL
USER $APP_UID
CMD ["bash"]