-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
26 lines (22 loc) · 1.14 KB
/
dockerfile
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
FROM mcr.microsoft.com/dotnet/sdk:8.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
RUN dotnet publish ./src/Echo/src/EchoTranslationEngine/EchoTranslationEngine.csproj -c Release -o out_echo_server
RUN dotnet publish ./src/Machine/src/Serval.Machine.EngineServer/Serval.Machine.EngineServer.csproj -c Release -o out_machine_engine_server
RUN dotnet publish ./src/Machine/src/Serval.Machine.JobServer/Serval.Machine.JobServer.csproj -c Release -o out_machine_job_server
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.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
COPY --from=build-env /app/out_echo_server ./echo_server
COPY --from=build-env /app/out_machine_engine_server ./machine_engine_server
COPY --from=build-env /app/out_machine_job_server ./machine_job_server
CMD ["bash"]