File size: 1,203 Bytes
a053ac4
 
f65a442
b384622
 
 
f65a442
47ab7c3
 
 
 
f65a442
 
 
 
 
 
 
b384622
 
f65a442
 
b384622
a053ac4
 
dfa2f23
 
 
 
 
 
dc0e2d8
 
 
 
 
f65a442
a053ac4
 
5d950e4
 
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
38
39
40
41
42
FROM python:3.9-slim

# Install system dependencies
RUN apt-get update && apt-get install -y \
    ffmpeg git build-essential python3-dev && \
    rm -rf /var/lib/apt/lists/*

# Install CPU-specific PyTorch (wheel from PyTorch index)
RUN pip install torch==2.1.1+cpu torchvision==0.16.1+cpu torchaudio==2.1.1+cpu \
    -f https://download.pytorch.org/whl/torch_stable.html

# Set working directory
WORKDIR /app/chatbot

# Allow deprecated sklearn install if needed
ENV SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True

# Upgrade pip and install Cython first (for youtokentome)
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir Cython

# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Set environment variables
ENV HF_HOME=/data/hf_cache
ENV TRANSFORMERS_CACHE=/data/transformers_cache
ENV NLTK_DATA=/data/nltk_data
ENV AUDIO_FOLDER=/data/audio

# Create writable directories
RUN mkdir -p /data/hf_cache /data/transformers_cache /data/nltk_data /data/audio /static/audio && \
    chmod -R 777 /data /static && \
    chmod -R 777 /root/.cache

# Copy application code
COPY . .

EXPOSE 7860
CMD ["python", "app.py"]