Spaces:
Sleeping
Sleeping
File size: 675 Bytes
b281f29 75ac32c b281f29 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# Use a minimal Python image
FROM python:3.9-slim
# Set the working directory
RUN useradd -m -u 1000 user
WORKDIR /app
# Copy dependencies and install them
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the application files
COPY . .
# Download necessary NLTK data
RUN python -c "import nltk; nltk.download('vader_lexicon'); nltk.download('punkt'); nltk.download('stopwords')"
COPY --chown=user . /app
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Expose the required port
EXPOSE 7860
# Run FastAPI
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|