Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
xBaank committed Jan 19, 2024
1 parent b8aae10 commit 47ea575
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ RUN apt install libsodium-dev -y
RUN apt install libopus-dev -y

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:7.0 AS build
ARG TARGETARCH
WORKDIR /src
COPY ["DiscordBot/DiscordBot.csproj", "DiscordBot/"]
COPY ["DiscordBot.MusicPlayer/DiscordBot.MusicPlayer.csproj", "DiscordBot.MusicPlayer/"]
RUN dotnet restore "DiscordBot/DiscordBot.csproj"
RUN dotnet restore "DiscordBot/DiscordBot.csproj" -a $TARGETARCH
COPY . .
WORKDIR "/src/DiscordBot"
RUN dotnet build "DiscordBot.csproj" -c Release -o /app/build
RUN dotnet build "DiscordBot.csproj" -a $TARGETARCH -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "DiscordBot.csproj" -c Release -o /app/publish
RUN dotnet publish "DiscordBot.csproj" -a $TARGETARCH --self-contained false -c Release -o /app/publish

FROM base AS final
WORKDIR /app
Expand Down

0 comments on commit 47ea575

Please sign in to comment.