Bikas0's picture
Dockerfile
53b96bd verified
raw
history blame
818 Bytes
# Use the official Python image from the Docker Hub
FROM python:3.10.0-slim-buster
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Create directories for NLTK and Hugging Face cache data and set environment variables
RUN mkdir -p /app/nltk_data /app/.cache/huggingface /app/.huggingface_cache \
&& chown -R 1000:1000 /app/nltk_data /app/.cache/huggingface /app/.huggingface_cache
ENV NLTK_DATA=/app/nltk_data
ENV HF_HOME=/app/.huggingface_cache
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Make port 7860 available to the world outside this container
EXPOSE 7860
# Command to run the application
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]