Files
Harun CAN 9d8c34b39d
Backend Deploy 🚀 / build-and-deploy (push) Has been cancelled
main
2026-04-25 14:37:46 +02:00

39 lines
1.1 KiB
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
WORKDIR /src
# Restore dependencies
COPY SaasMediaWorker.csproj .
RUN dotnet restore
# Build
COPY . .
RUN dotnet publish -c Release -o /app/publish --no-restore
# Runtime — ARM64 uyumlu Alpine image
FROM mcr.microsoft.com/dotnet/runtime:8.0-alpine AS runtime
WORKDIR /app
# FFmpeg, Node.js (Remotion için) ve Chromium (Puppeteer/Remotion için) kurulumu
RUN apk add --no-cache ffmpeg font-dejavu icu-libs nodejs npm chromium nss freetype harfbuzz ttf-freefont
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
# Temp dizin oluştur
RUN mkdir -p /tmp/contgen-render
COPY --from=build /app/publish .
# Remotion projesini kopyala ve bağımlılıkları kur
COPY remotion ./remotion
RUN cd remotion && npm ci
# Non-root user ile çalıştır (güvenlik)
RUN adduser -D -h /app workeruser && \
chown -R workeruser:workeruser /app/remotion && \
chown -R workeruser:workeruser /tmp/contgen-render
USER workeruser
ENTRYPOINT ["dotnet", "SaasMediaWorker.dll"]