fixed build, fixed dockerfile not building properly

This commit is contained in:
Toastie 2025-02-11 13:59:12 +13:00
parent d9c27021aa
commit 4f1cdde9b2
Signed by: toastie_t0ast
GPG key ID: 0861BE54AD481DC7
3 changed files with 52 additions and 53 deletions

View file

@ -8,9 +8,10 @@ COPY src/EllieBot/*.csproj src/EllieBot/
COPY src/EllieBot.Coordinator/*.csproj src/EllieBot.Coordinator/
COPY src/EllieBot.Generators/*.csproj src/EllieBot.Generators/
COPY src/EllieBot.Voice/*.csproj src/EllieBot.Voice/
COPY src/EllieBot.GrpcApiBase/*.csproj src/EllieBot.GrpcApiBase/
# Restore the dependencies for the EllieBot project
RUN dotnet restore src/EllieBot/
RUN dotnet restore src/EllieBot/ -r linux-x64
# Copy the rest of the source code
COPY . .
@ -19,7 +20,6 @@ COPY . .
WORKDIR /source/src/EllieBot
# Build and publish the EllieBot project, then clean up unnecessary files
RUN dotnet restore
RUN dotnet publish -c Release -o /app --self-contained -r linux-x64 --no-restore; \
mv /app/data /app/data_init; \
chmod +x /app/EllieBot
@ -30,10 +30,11 @@ WORKDIR /app
# Create a new user, install dependencies, and set up sudoers file
RUN apt update; \
apt install -y curl ffmpeg python3; \
apt install -y --no-install-recommends curl ffmpeg python3; \
curl -Lo /usr/local/bin/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp; \
chmod a+rx /usr/local/bin/yt-dlp; \
apt autoremove -y;
apt autoremove -y; \
apt clean -y;
# Copy the built application and the entrypoint script from the build stage
COPY --from=build /app ./