Amber-Portfolio / Dockerfile
Dwarakesh-V's picture
Modified Dockerfile
829cfd4
raw
history blame contribute delete
740 Bytes
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile
FROM python:3.9
# Create a user for security
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
# Set working directory
WORKDIR /app
# Install Python dependencies
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the rest of the code
COPY --chown=user . /app
# NLTK needs tokenizer data
RUN python -m nltk.downloader punkt
RUN python -m nltk.downloader punkt_tab
# Run FastAPI app via Uvicorn on port 7860 (used by Hugging Face Spaces)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]