File size: 1,087 Bytes
720ed94
 
 
 
 
 
 
02c63da
 
720ed94
02c63da
 
 
 
 
 
720ed94
deef937
 
02c63da
720ed94
 
02c63da
 
 
 
 
 
720ed94
 
 
 
02c63da
 
 
720ed94
 
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
34
35
36
37
# 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"]