forked from planetarium/NineChronicles.Snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (24 loc) · 882 Bytes
/
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
27
28
29
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
WORKDIR /app
ARG COMMIT
COPY ./libplanet/Libplanet/Libplanet.csproj ./Libplanet/
COPY ./libplanet/Libplanet.RocksDBStore/Libplanet.RocksDBStore.csproj ./Libplanet.RocksDBStore/
COPY ./NineChronicles.Snapshot/NineChronicles.Snapshot.csproj ./NineChronicles.Snapshot/
RUN dotnet restore Libplanet
RUN dotnet restore Libplanet.RocksDBStore
RUN dotnet restore NineChronicles.Snapshot
# Copy everything else and build
COPY . ./
RUN dotnet publish NineChronicles.Snapshot/NineChronicles.Snapshot.csproj \
-c Release \
-r linux-x64 \
-o out \
--self-contained \
--version-suffix $COMMIT
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /app
RUN apt-get update && apt-get install -y libc6-dev
COPY --from=build-env /app/out .
VOLUME /data
ENTRYPOINT ["dotnet", "NineChronicles.Snapshot.dll"]