amanm10000's picture
efgh
02c63da
raw
history blame
1.09 kB
# Use Python 3.10 as base image
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN echo "Installing system dependencies..." && \
apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/* && \
echo "System dependencies installed successfully!"
# Create NLTK data directory and set permissions
RUN mkdir -p /nltk_data && \
chmod 777 /nltk_data
# Copy all application files
COPY . .
RUN echo "Application files copied successfully!"
# Install Python dependencies
RUN echo "Installing Python dependencies..." && \
pip install --no-cache-dir -r requirements.txt && \
echo "Python dependencies installed successfully!"
# Download NLTK data
RUN python -c "import nltk; nltk.download('averaged_perceptron_tagger_eng', quiet=True)"
# Expose the port the app runs on
EXPOSE 7860
# Show directory contents before running the application
RUN echo "Contents of working directory:" && ls -la
# Command to run the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]