Last active 1 week ago

philip's Avatar philip revised this gist 1 week ago. Go to revision

1 file changed, 39 insertions

Dockerfile(file created)

@@ -0,0 +1,39 @@
1 + #See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
2 +
3 + FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
4 + WORKDIR /app
5 + EXPOSE 5000
6 +
7 + FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS build
8 + ARG TARGETARCH
9 + ARG BUILD_CONFIGURATION=Release
10 + WORKDIR /src
11 + COPY ["WeddingShare/WeddingShare.csproj", "WeddingShare/"]
12 + RUN dotnet restore -a $TARGETARCH "./WeddingShare/./WeddingShare.csproj"
13 + COPY . .
14 + WORKDIR "/src/WeddingShare"
15 + RUN dotnet build "./WeddingShare.csproj" -a $TARGETARCH -c $BUILD_CONFIGURATION -o /app/build
16 +
17 + FROM build AS publish
18 + ARG BUILD_CONFIGURATION=Release
19 + RUN dotnet publish "./WeddingShare.csproj" -a $TARGETARCH -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
20 +
21 + FROM debian:12 as ffmpeg
22 + RUN apt update
23 + RUN apt install -y wget unzip
24 + WORKDIR /ffmpeg
25 + # Replace these links with the arm ones from the link above
26 + RUN wget https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v6.1/ffmpeg-6.1-linux-arm-64.zip
27 + RUN wget https://github.com/ffbinaries/ffbinaries-prebuilt/releases/download/v6.1/ffprobe-6.1-linux-arm-64.zip
28 + RUN unzip ffmpeg-6.1-linux-arm-64.zip
29 + RUN unzip ffprobe-6.1-linux-arm-64.zip
30 +
31 + FROM base AS final
32 + WORKDIR /ffmpeg
33 + COPY --from=ffmpeg /ffmpeg/ffmpeg .
34 + COPY --from=ffmpeg /ffmpeg/ffprobe .
35 + COPY --from=ffmpeg /ffmpeg/ffmpeg /usr/local/bin/ffmpeg
36 + COPY --from=ffmpeg /ffmpeg/ffprobe /usr/local/bin/ffprobe
37 + WORKDIR /app
38 + COPY --from=publish /app/publish .
39 + ENTRYPOINT ["dotnet", "WeddingShare.dll"]
Newer Older