Skip to content

Commit

Permalink
docker也得official!
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyl18 committed Jun 27, 2022
1 parent 84af13c commit 5cd8705
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/runtime:3.1 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:3.1 AS publish
WORKDIR /src
COPY ["WFBot/WFBot.csproj", "WFBot/"]
RUN dotnet restore "WFBot/WFBot.csproj"
COPY . .
ENV OFFICIAL_BUILD=official
#WORKDIR "/src/WFBot"
RUN dotnet publish "WFBot" -c "Linux Release" -o /app/publish && rm -rf .git

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "WFBot.dll", "--", "--use-config-folder"]
5 changes: 5 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Use Custom Dockerfile
run: |
rm Dockerfile
cp .github/Dockerfile .
- name: Build and push
uses: docker/build-push-action@v2
with:
Expand Down

0 comments on commit 5cd8705

Please sign in to comment.