fix .net docker build

This commit is contained in:
alyssa 2025-05-18 13:19:20 +00:00
parent 0fa0070d41
commit e573e978da
5 changed files with 13 additions and 2 deletions

View file

@ -4,6 +4,7 @@
# Include project code and build files
!PluralKit.*/
!Myriad/
!Serilog/
!.git
!dashboard
!crates/

View file

@ -2,7 +2,9 @@ name: Build and push Docker image
on:
push:
paths:
- '.github/workflows/docker.yml'
- '.dockerignore'
- '.github/workflows/dotnet-docker.yml'
- 'ci/Dockerfile.dotnet'
- 'ci/dotnet-version.sh'
- 'Myriad/**'
- 'PluralKit.API/**'
@ -23,6 +25,9 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.CR_PAT }}
- uses: actions/checkout@v2
with:
submodules: true
- run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" | sed 's|/|-|g' >> $GITHUB_ENV
- name: Extract Docker metadata
@ -41,6 +46,7 @@ jobs:
with:
# https://github.com/docker/build-push-action/issues/378
context: .
file: ci/Dockerfile.dotnet
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=registry,ref=ghcr.io/pluralkit/pluralkit:${{ env.BRANCH_NAME }}

View file

@ -3,6 +3,7 @@ on:
push:
paths:
- 'crates/**'
- '.dockerignore'
- '.github/workflows/rust.yml'
- 'ci/Dockerfile.rust'
- 'ci/rust-docker-target.sh'

View file

@ -10,6 +10,7 @@ COPY PluralKit.Bot/PluralKit.Bot.csproj /app/PluralKit.Bot/
COPY PluralKit.Core/PluralKit.Core.csproj /app/PluralKit.Core/
COPY PluralKit.Tests/PluralKit.Tests.csproj /app/PluralKit.Tests/
COPY .git/ /app/.git
COPY Serilog/ /app/Serilog/
RUN dotnet restore PluralKit.sln
# Copy the rest of the code and build

View file

@ -2,7 +2,9 @@ version: "3"
services:
bot:
build: .
build:
context: .
dockerfile: ci/Dockerfile.dotnet
command: ["bin/PluralKit.Bot.dll"]
environment:
- "PluralKit__Database=Host=db;Username=postgres;Password=postgres;Database=postgres"