Optimize dockerfile

pull/162/head
Oleksii Holub 6 years ago
parent 0a60dea5c1
commit cac48b3541

@ -1,12 +1,29 @@
# Build
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY favicon.ico ./
COPY DiscordChatExporter.Core.Markdown/*.csproj DiscordChatExporter.Core.Markdown/
RUN dotnet restore DiscordChatExporter.Core.Markdown
COPY DiscordChatExporter.Core/*.csproj DiscordChatExporter.Core/
RUN dotnet restore DiscordChatExporter.Core
COPY DiscordChatExporter.Cli/*.csproj DiscordChatExporter.Cli/
RUN dotnet restore DiscordChatExporter.Cli
COPY DiscordChatExporter.Core.Markdown DiscordChatExporter.Core.Markdown
COPY DiscordChatExporter.Core DiscordChatExporter.Core
COPY DiscordChatExporter.Cli DiscordChatExporter.Cli
COPY DiscordChatExporter.sln favicon.ico ./
RUN dotnet build DiscordChatExporter.Cli -c Release -f netcoreapp2.1
FROM build AS app
# Run
FROM microsoft/dotnet:2.1-runtime AS run
WORKDIR /app
COPY --from=build /src/DiscordChatExporter.Cli/bin/Release/netcoreapp2.1 ./
ENTRYPOINT ["dotnet", "DiscordChatExporter.Cli.dll"]
ENTRYPOINT ["dotnet", "DiscordChatExporter.Cli.dll"]
CMD ["-o", "out/"]
Loading…
Cancel
Save