Manifesto_Explainer / Dockerfile
Sa-m's picture
Upload folder using huggingface_hub
c00891c verified
Raw
History Blame Contribute Delete
844 Bytes
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PORT 8080
WORKDIR /app
# Install system dependencies for some python packages if needed
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy project files
COPY . .
# Download NLTK resources during build to optimize startup
RUN python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords'); nltk.download('punkt_tab'); nltk.download('words'); nltk.download('wordnet')"
# Expose port
EXPOSE 8080
# Start the application using shell form to allow environment variable expansion
CMD uvicorn main:app --host 0.0.0.0 --port ${PORT:-8080}