Files
astrocore/Astrocore.Api/Dockerfile
root 30b4b1df32
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 4m35s
Update Astrocore.Api/Dockerfile
2025-12-13 15:46:53 -05:00

32 lines
856 B
Docker

# Build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["Astrocore.Api/Astrocore.Api.csproj", "Astrocore.Api/"]
RUN dotnet restore "./Astrocore.Api/Astrocore.Api.csproj"
COPY . .
WORKDIR /src/Astrocore.Api
RUN dotnet publish "./Astrocore.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
# Runtime with ffmpeg already included
FROM jrottenberg/ffmpeg:6.1-ubuntu2204 AS runtime-ffmpeg
# .NET runtime
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
WORKDIR /app
# Copy ffmpeg binaries into the final image
COPY --from=runtime-ffmpeg /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg
COPY --from=runtime-ffmpeg /usr/local/bin/ffprobe /usr/local/bin/ffprobe
COPY --from=build /app/publish .
ARG APP_UID
USER $APP_UID
EXPOSE 8080
EXPOSE 8081
ENTRYPOINT ["dotnet", "Astrocore.Api.dll"]