arima / DockerFile
AgentCrafter's picture
Update DockerFile
3f6e836 verified
Raw
History Blame Contribute Delete
550 Bytes
# Simple Dockerfile for Flask API on Hugging Face Spaces
FROM python:3.11-slim
# Optional: non-root user (recommended by HF)
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
# Install deps
COPY --chown=user requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the code
COPY --chown=user . /app
# Hugging Face expects apps to listen on port 7860
ENV PORT=7860
# Expose port (for clarity)
EXPOSE 7860
# Start your Flask app
CMD ["python", "server.py"]