mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-28 13:44:12 -04:00
Simplify dockerfile
This commit is contained in:
parent
47d8163a46
commit
65a528e7fe
4 changed files with 22 additions and 24 deletions
6
.github/workflows/docker.yml
vendored
6
.github/workflows/docker.yml
vendored
|
@ -11,7 +11,7 @@ jobs:
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Build container
|
- name: Build container
|
||||||
run: docker build .
|
run: docker build -f DiscordChatExporter.Cli.dockerfile .
|
||||||
|
|
||||||
deploy-latest:
|
deploy-latest:
|
||||||
if: ${{ github.event_name == 'push' && github.ref_type == 'branch' && github.ref_name == 'master' }}
|
if: ${{ github.event_name == 'push' && github.ref_type == 'branch' && github.ref_name == 'master' }}
|
||||||
|
@ -25,7 +25,7 @@ jobs:
|
||||||
run: docker login -u tyrrrz -p ${{ secrets.DOCKER_TOKEN }}
|
run: docker login -u tyrrrz -p ${{ secrets.DOCKER_TOKEN }}
|
||||||
|
|
||||||
- name: Build container
|
- name: Build container
|
||||||
run: docker build -t tyrrrz/discordchatexporter:latest .
|
run: docker build -f DiscordChatExporter.Cli.dockerfile -t tyrrrz/discordchatexporter:latest .
|
||||||
|
|
||||||
- name: Push container
|
- name: Push container
|
||||||
run: docker push tyrrrz/discordchatexporter:latest
|
run: docker push tyrrrz/discordchatexporter:latest
|
||||||
|
@ -46,7 +46,7 @@ jobs:
|
||||||
run: docker login -u tyrrrz -p ${{ secrets.DOCKER_TOKEN }}
|
run: docker login -u tyrrrz -p ${{ secrets.DOCKER_TOKEN }}
|
||||||
|
|
||||||
- name: Build container
|
- name: Build container
|
||||||
run: docker build -t tyrrrz/discordchatexporter:stable -t tyrrrz/discordchatexporter:${{ steps.get_version.outputs.tag }} .
|
run: docker build -f DiscordChatExporter.Cli.dockerfile -t tyrrrz/discordchatexporter:stable -t tyrrrz/discordchatexporter:${{ steps.get_version.outputs.tag }} .
|
||||||
|
|
||||||
- name: Push container (stable)
|
- name: Push container (stable)
|
||||||
run: docker push tyrrrz/discordchatexporter:stable
|
run: docker push tyrrrz/discordchatexporter:stable
|
||||||
|
|
18
DiscordChatExporter.Cli.dockerfile
Normal file
18
DiscordChatExporter.Cli.dockerfile
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Build
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||||
|
|
||||||
|
COPY favicon.ico ./
|
||||||
|
COPY NuGet.config ./
|
||||||
|
COPY Directory.Build.props ./
|
||||||
|
COPY DiscordChatExporter.Core ./DiscordChatExporter.Core
|
||||||
|
COPY DiscordChatExporter.Cli ./DiscordChatExporter.Cli
|
||||||
|
|
||||||
|
RUN dotnet publish DiscordChatExporter.Cli -c Release -o ./publish
|
||||||
|
|
||||||
|
# Run
|
||||||
|
FROM mcr.microsoft.com/dotnet/runtime:6.0 AS run
|
||||||
|
|
||||||
|
COPY --from=build ./publish ./
|
||||||
|
|
||||||
|
WORKDIR ./out
|
||||||
|
ENTRYPOINT ["dotnet", "/DiscordChatExporter.Cli.dll"]
|
|
@ -9,7 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||||
License.txt = License.txt
|
License.txt = License.txt
|
||||||
Readme.md = Readme.md
|
Readme.md = Readme.md
|
||||||
Directory.Build.props = Directory.Build.props
|
Directory.Build.props = Directory.Build.props
|
||||||
Dockerfile = Dockerfile
|
DiscordChatExporter.Cli.dockerfile = DiscordChatExporter.Cli.dockerfile
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscordChatExporter.Gui", "DiscordChatExporter.Gui\DiscordChatExporter.Gui.csproj", "{732A67AF-93DE-49DF-B10F-FD74710B7863}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscordChatExporter.Gui", "DiscordChatExporter.Gui\DiscordChatExporter.Gui.csproj", "{732A67AF-93DE-49DF-B10F-FD74710B7863}"
|
||||||
|
|
20
Dockerfile
20
Dockerfile
|
@ -1,20 +0,0 @@
|
||||||
# Build
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
|
||||||
WORKDIR /src
|
|
||||||
|
|
||||||
COPY favicon.ico ./
|
|
||||||
COPY NuGet.config ./
|
|
||||||
COPY Directory.Build.props ./
|
|
||||||
COPY DiscordChatExporter.Core DiscordChatExporter.Core
|
|
||||||
COPY DiscordChatExporter.Cli DiscordChatExporter.Cli
|
|
||||||
|
|
||||||
RUN dotnet publish DiscordChatExporter.Cli -o DiscordChatExporter.Cli/publish -c Release
|
|
||||||
|
|
||||||
# Run
|
|
||||||
FROM mcr.microsoft.com/dotnet/runtime:6.0 AS run
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY --from=build /src/DiscordChatExporter.Cli/publish ./
|
|
||||||
|
|
||||||
WORKDIR /app/out
|
|
||||||
ENTRYPOINT ["dotnet", "/app/DiscordChatExporter.Cli.dll"]
|
|
Loading…
Add table
Add a link
Reference in a new issue