forked from planetarium/libplanet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.explorer
36 lines (30 loc) · 1.21 KB
/
Dockerfile.explorer
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
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
# Note that it's ordered by the least frequently changed
COPY ./Libplanet.Stun/Libplanet.Stun.csproj ./Libplanet.Stun/
RUN dotnet restore Libplanet.Stun
COPY ./Libplanet.RocksDBStore/Libplanet.RocksDBStore.csproj ./Libplanet.RocksDBStore/
RUN dotnet restore Libplanet.RocksDBStore
COPY ./Libplanet.Explorer.Executable/Libplanet.Explorer.Executable.csproj ./Libplanet.Explorer.Executable/
RUN dotnet restore Libplanet.Explorer.Executable
COPY ./Libplanet.Explorer/Libplanet.Explorer.csproj ./Libplanet.Explorer/
RUN dotnet restore Libplanet.Explorer
COPY ./Libplanet/Libplanet.csproj ./Libplanet/
RUN dotnet restore Libplanet
# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -r linux-x64 -o out Libplanet.Explorer.Executable
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /app
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 \
&& rm -rf /var/lib/apt/lists/*
# Runtime settings
EXPOSE 5000
VOLUME /data
ENTRYPOINT ["Libplanet.Explorer.Executable"]