Arrow / Dockerfile
Noblhyon's picture
Update Dockerfile
0f40c32 verified
# Use Python 3.10 slim image
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PORT=7860
# Create a non-root user (required for Hugging Face Spaces)
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Copy requirements and install dependencies
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY --chown=user app.py .
# Expose port 7860
EXPOSE 7860
# Run the application
CMD ["python", "app.py"]