FROM zhongbai233/tomato-novel-downloader-webui:latest # Switch to root to install packages USER root RUN apk add --no-cache \ nginx \ gettext \ bash # Setup directory for HTML and Nginx RUN mkdir -p /app/html \ && mkdir -p /data \ && chown -R 1000:1000 /app \ && chown -R 1000:1000 /data \ && chown -R 1000:1000 /var/lib/nginx \ && chown -R 1000:1000 /var/log/nginx \ && chmod -R 777 /app \ && chmod -R 777 /data \ && chmod -R 777 /var/lib/nginx \ && chmod -R 777 /var/log/nginx # Copy configuration and scripts COPY --chown=1000:1000 nginx.conf /etc/nginx/nginx.conf.template COPY --chown=1000:1000 fake_error.html /app/html/fake_error.html COPY --chown=1000:1000 entrypoint.sh /app/custom_entrypoint.sh RUN chmod +x /app/custom_entrypoint.sh # Switch to user 1000 for Hugging Face Spaces compatibility USER 1000 WORKDIR /app # The port HF Spaces uses EXPOSE 7860 # We use our custom entrypoint instead of the base image's entrypoint ENTRYPOINT ["/app/custom_entrypoint.sh"]