-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
53 lines (39 loc) · 1.22 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
ARG configuration=Release
###########################
#
# Runtime container build
#
###########################
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-bionic AS runtime
WORKDIR /app
EXPOSE 80
###########################
#
# Build container
#
###########################
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
ARG version=0.0.0-dev
WORKDIR /src
# Project assemblies for layer caching
COPY TezosNotifyBot.sln .
COPY TezosNotifyBot/TezosNotifyBot.csproj ./TezosNotifyBot/
COPY TezosNotifyBot.Dialog/TezosNotifyBot.Dialog.csproj ./TezosNotifyBot.Dialog/
COPY TezosNotifyBot.Shared/TezosNotifyBot.Shared.csproj ./TezosNotifyBot.Shared/
COPY TezosNotifyBot.Domain/TezosNotifyBot.Domain.csproj ./TezosNotifyBot.Domain/
COPY TezosNotifyBot.Storage/TezosNotifyBot.Storage.csproj ./TezosNotifyBot.Storage/
# Restore dependencies (with nuget cache)
RUN dotnet restore --packages /nuget
# Copy all sources
COPY . .
WORKDIR /src/TezosNotifyBot
## Publish backend assembly
RUN dotnet publish --output /out --no-restore -v m /property:Version=${version}
###########################
#
# Runtime layer
#
###########################
FROM runtime
COPY --from=build /out /app
ENTRYPOINT ["dotnet", "TezosNotifyBot.dll", "--migrate"]