-
Notifications
You must be signed in to change notification settings - Fork 43
/
Dockerfile.ACC.amd64
37 lines (31 loc) · 1.28 KB
/
Dockerfile.ACC.amd64
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
29
30
31
32
33
34
35
36
37
# Use the SDK image to build the app
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build-env
WORKDIR /app
ARG COMMIT
# Copy csproj and restore as distinct layers
COPY ./Lib9c/Lib9c/Lib9c.csproj ./Lib9c/
COPY ./NineChronicles.Headless/NineChronicles.Headless.csproj ./NineChronicles.Headless/
COPY ./NineChronicles.Headless.AccessControlCenter/NineChronicles.Headless.AccessControlCenter.csproj ./NineChronicles.Headless.AccessControlCenter/
RUN dotnet restore Lib9c
RUN dotnet restore NineChronicles.Headless
RUN dotnet restore NineChronicles.Headless.AccessControlCenter
# Copy everything else and build
COPY . ./
RUN dotnet publish NineChronicles.Headless.AccessControlCenter/NineChronicles.Headless.AccessControlCenter.csproj \
-c Release \
-r linux-x64 \
-o out \
--self-contained \
--version-suffix $COMMIT
# Build runtime image
FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim
WORKDIR /app
RUN apt-get update && apt-get install -y libc6-dev
COPY --from=build-env /app/out .
# Install native deps & utilities for production
RUN apt-get update \
&& apt-get install -y --allow-unauthenticated \
libc6-dev jq curl \
&& rm -rf /var/lib/apt/lists/*
VOLUME /data
ENTRYPOINT ["dotnet", "NineChronicles.Headless.AccessControlCenter.dll"]