doublesizebed commited on
Commit
f65a442
·
1 Parent(s): a86cf1b

Updates Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -12
Dockerfile CHANGED
@@ -1,22 +1,28 @@
1
  FROM python:3.9-slim
2
 
3
- # System deps
4
- RUN apt-get update && apt-get install -y ffmpeg git && rm -rf /var/lib/apt/lists/*
5
-
6
- WORKDIR /app/chatbot
7
- ENV SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
8
  RUN apt-get update && apt-get install -y \
9
  ffmpeg git build-essential python3-dev && \
10
  rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
11
  RUN pip install --no-cache-dir --upgrade pip
12
  RUN pip install --no-cache-dir Cython
 
 
13
  COPY requirements.txt .
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
-
17
- # Create writable directories
18
- RUN mkdir -p /data/hf_cache /data/transformers_cache /data/nltk_data /static/audio
19
- RUN chmod -R 777 /static/audio
20
 
21
  # Set environment variables
22
  ENV HF_HOME=/data/hf_cache
@@ -24,10 +30,11 @@ ENV TRANSFORMERS_CACHE=/data/transformers_cache
24
  ENV NLTK_DATA=/data/nltk_data
25
  ENV AUDIO_FOLDER=/data/audio
26
 
27
- # Copy source
28
  COPY . .
29
 
 
30
  EXPOSE 5000
31
 
32
- # Run via a production WSGI server (you can also use gunicorn or waitress)
33
- CMD ["waitress-serve", "--listen=0.0.0.0:5000", "app:app"]
 
1
  FROM python:3.9-slim
2
 
3
+ # Install system dependencies
 
 
 
 
4
  RUN apt-get update && apt-get install -y \
5
  ffmpeg git build-essential python3-dev && \
6
  rm -rf /var/lib/apt/lists/*
7
+
8
+ # Set working directory
9
+ WORKDIR /app/chatbot
10
+
11
+ # Allow deprecated sklearn install if needed
12
+ ENV SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
13
+
14
+ # Upgrade pip and install Cython first (for youtokentome)
15
  RUN pip install --no-cache-dir --upgrade pip
16
  RUN pip install --no-cache-dir Cython
17
+
18
+ # Install Python dependencies
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
+ # Create writable cache & audio directories
23
+ RUN mkdir -p /data/hf_cache /data/transformers_cache /data/nltk_data /data/audio static/audio && \
24
+ chmod -R 777 /data static/audio && \
25
+ chmod -R 777 /root/.cache
26
 
27
  # Set environment variables
28
  ENV HF_HOME=/data/hf_cache
 
30
  ENV NLTK_DATA=/data/nltk_data
31
  ENV AUDIO_FOLDER=/data/audio
32
 
33
+ # Copy application code
34
  COPY . .
35
 
36
+ # Expose port
37
  EXPOSE 5000
38
 
39
+ # Start app using waitress
40
+ CMD ["waitress-serve", "--listen=0.0.0.0:5000", "app:app"]