dockerize Agent

This commit is contained in:
Collin M. Barrett 2019-06-26 18:56:16 -05:00
parent 095c37e7b1
commit 4497cab46b
3 changed files with 34 additions and 1 deletions

View file

@ -32,7 +32,6 @@ LICENSE
# FilterLists custom
FilterLists.sln
FilterLists.Api.sln
src/FilterLists.Agent
imgs
ops
data/TPLSubscriptionAssistant.html

View file

@ -56,6 +56,13 @@ services:
"--collation-server=utf8mb4_unicode_520_ci"
]
agent:
image: collinbarrett/filterlists.agent:latest
build:
context: .
dockerfile: src/FilterLists.Agent/Dockerfile
target: final
networks:
reverse-proxy:
api:

View file

@ -0,0 +1,27 @@
# Context: .
# Command: docker build -f src/FilterLists.Agent/Dockerfile .
# init base
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-alpine as base
ENTRYPOINT ["dotnet", "FilterLists.Agent.dll"]
WORKDIR /app
# init build
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-alpine AS build
# restore
WORKDIR /app/src/FilterLists.Agent
COPY src/FilterLists.Agent/FilterLists.Agent.csproj .
RUN dotnet restore
# build
COPY src/FilterLists.Agent/. .
RUN dotnet build -c Release --no-restore
# publish
FROM build AS publish
RUN dotnet publish -c Release -o out --no-restore --no-build
# final
FROM base as final
COPY --from=publish /app/src/FilterLists.Agent/out .