# Dify All-in-One for HF Spaces FROM langgenius/dify-web:1.11.3 AS web FROM langgenius/dify-api:1.11.3 USER root # Install Nginx and Locales RUN apt-get update && apt-get install -y --no-install-recommends nginx locales \ && rm -rf /var/lib/apt/lists/* \ && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ENV LANG=en_US.UTF-8 # Copy pre-built web COPY --from=web /app/web /app/web # Copy config files COPY nginx.conf /etc/nginx/nginx.conf # Force Cache Busting (Change value to force rebuild) ARG FORCE_REBUILD=20260114_1637 COPY start.sh /app/start.sh RUN chmod +x /app/start.sh && \ mkdir -p /app/api/storage /var/log/nginx /var/lib/nginx /run /var/cache/nginx && \ chown -R 1000:1000 /app /var/log/nginx /var/lib/nginx /run /var/cache/nginx /etc/nginx ENV PORT=7860 \ MODE=api \ DEBUG=false \ STORAGE_TYPE=local \ STORAGE_LOCAL_PATH=/app/api/storage EXPOSE 7860 USER 1000 WORKDIR /app/api ENTRYPOINT [] CMD ["/bin/bash", "/app/start.sh"]