FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build ARG VERSION # Copy source code COPY ["OF DL.sln", "/src/OF DL.sln"] COPY ["OF DL", "/src/OF DL"] WORKDIR "/src" # Build release RUN dotnet publish -p:WarningLevel=0 -p:Version=$VERSION -c Release --self-contained true -p:PublishSingleFile=true -o out # Generate default config.conf files RUN /src/out/OF\ DL --non-interactive || true && \ # Set download path in default config.conf to /data sed -e 's/DownloadPath = ""/DownloadPath = "\/data"/' /src/config.conf > /src/updated_config.conf && \ mv /src/updated_config.conf /src/config.conf FROM mcr.microsoft.com/dotnet/runtime:8.0 AS final # Install dependencies RUN apt-get update \ && apt-get install -y \ tini \ ffmpeg \ supervisor \ xvfb \ x11vnc \ novnc \ npm \ && rm -rf /var/lib/apt/lists/* RUN npx playwright install --with-deps chromium RUN apt-get remove --purge -y npm \ && apt-get autoremove -y # Redirect webroot to vnc.html instead of displaying directory listing RUN echo "" > /usr/share/novnc/index.html # Create directories for configuration and downloaded files RUN mkdir /data /config /config/logs /default-config # Copy release COPY --from=build /src/out /app # Copy default configuration files COPY --from=build /src/config.conf /default-config COPY --from=build ["/src/OF DL/rules.json", "/default-config"] COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY docker/entrypoint.sh /app/entrypoint.sh RUN chmod +x /app/entrypoint.sh ENV DISPLAY=:0.0 \ DISPLAY_WIDTH=1024 \ DISPLAY_HEIGHT=768 \ OFDL_DOCKER=true EXPOSE 8080 WORKDIR /config ENTRYPOINT ["/usr/bin/tini", "--"] CMD ["/app/entrypoint.sh"]