# Use Alpine Linux (Only 5MB base size) FROM alpine:latest # Install dependencies # qemu-system-i386: The emulator # python3 & py3-numpy: Required for the web bridge # bash: To run our script # wget & unzip: To download files RUN apk add --no-cache \ qemu-system-i386 \ qemu-ui-gtk \ python3 \ py3-numpy \ bash \ wget \ unzip # Set working directory WORKDIR /app # Create a user (Hugging Face security requirement) # Alpine uses 'adduser' instead of 'useradd' RUN adduser -D -u 1000 user RUN chown -R user:user /app # Switch to user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # Copy the start script COPY --chown=user:user start.sh /app/start.sh RUN chmod +x /app/start.sh # Expose the specific port EXPOSE 7860 # Run CMD ["/app/start.sh"]