research-paper-api / Dockerfile
O7tecOG's picture
Create Dockerfile
97a1cef verified
Raw
History Blame Contribute Delete
719 Bytes
# Use an official Python runtime
FROM python:3.10-slim
# Install system dependencies (including Graphviz)
RUN apt-get update && apt-get install -y \
graphviz \
&& rm -rf /var/lib/apt/lists/*
# Hugging Face requires running as a non-root user
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
# Copy requirements and install
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY --chown=user . .
# Expose Hugging Face's required port
EXPOSE 7860
# Start the FastAPI application on port 7860
CMD ["uvicorn", "Streamlit_API:app", "--host", "0.0.0.0", "--port", "7860"]