FROM rustfs/rustfs:1.0.0-alpha.72 AS rustfs_base # Now build our custom image with nginx FROM debian:bookworm-slim # Install nginx and other dependencies RUN apt-get update && apt-get install -y \ curl \ ca-certificates \ nginx \ procps \ && rm -rf /var/lib/apt/lists/* # Copy RustFS binary from official image (correct location is /usr/bin/rustfs) COPY --from=rustfs_base /usr/bin/rustfs /usr/local/bin/rustfs # Install MinIO Client (mc) for bucket management RUN curl -o /usr/local/bin/mc https://dl.min.io/client/mc/release/linux-amd64/mc && \ chmod +x /usr/local/bin/mc && \ chmod +x /usr/local/bin/rustfs # Create directories with proper permissions RUN mkdir -p /data /var/log/rustfs && chmod 777 /data # Copy configuration files COPY nginx.conf /etc/nginx/nginx.conf COPY entrypoint.sh /usr/local/bin/entrypoint.sh COPY README.md /app/README.md # Set permissions RUN chmod +x /usr/local/bin/entrypoint.sh WORKDIR /app # Expose port for HuggingFace Spaces EXPOSE 7860 CMD ["/usr/local/bin/entrypoint.sh"]