Skip to content

Commit

Permalink
Added dockerfile for running the bot
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiascibien committed Jul 21, 2019
1 parent 3050e98 commit 7ae85d2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
.gitignore
.env
LICENSE
README.md
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-alpine AS build
WORKDIR /app

# copy csproj and restore as distinct layers
COPY *.csproj ./image-search-bot/
WORKDIR /app/image-search-bot
RUN dotnet restore

# copy and publish app and libraries
WORKDIR /app/
COPY ./ ./image-search-bot/
WORKDIR /app/image-search-bot
RUN dotnet publish -c Release -o out

# run application
FROM mcr.microsoft.com/dotnet/core/runtime:2.2-alpine AS runtime
WORKDIR /app
COPY --from=build /app/image-search-bot/out ./
CMD dotnet image-search-bot.dll

0 comments on commit 7ae85d2

Please sign in to comment.