forked from planetarium/libplanet-seed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (23 loc) · 803 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/core/sdk:3.1 AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY ./Libplanet.Seed/Libplanet.Seed.csproj ./Libplanet.Seed/
COPY ./Libplanet.Seed.Executable/Libplanet.Seed.Executable.csproj ./Libplanet.Seed.Executable/
RUN dotnet restore Libplanet.Seed
RUN dotnet restore Libplanet.Seed.Executable
# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -r linux-x64 -o out
# Build runtime image
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
WORKDIR /app
COPY --from=build-env /app/out .
# Install native deps
RUN apt-get update \
&& apt-get install -y --allow-unauthenticated \
libc6-dev \
&& rm -rf /var/lib/apt/lists/*
# Runtime settings
EXPOSE 5000
VOLUME /data
ENTRYPOINT ["/app/Libplanet.Seed.Executable"]