Bushra-KB commited on
Commit
975eab2
·
verified ·
1 Parent(s): a9c8f0c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -5
Dockerfile CHANGED
@@ -6,14 +6,14 @@ ENV HF_HOME=/data/huggingface
6
  ENV TORCH_HOME=/data/torch
7
  ENV TRANSFORMERS_CACHE=/data/huggingface/hub
8
  ENV HF_DATASETS_CACHE=/data/huggingface/datasets
9
- ENV HOME=/tmp
10
  # Create the cache directories and make them writable by any user
11
  RUN mkdir -p $TRANSFORMERS_CACHE $HF_DATASETS_CACHE $TORCH_HOME && \
12
  chmod -R 777 /data
13
 
14
  # System deps for soundfile, audio encoding, and uroman
15
  RUN apt-get update && apt-get install -y --no-install-recommends \
16
- libsndfile1 ffmpeg git && \
17
  rm -rf /var/lib/apt/lists/*
18
 
19
  # Clone and install uroman from source so the tokenizer can find it
@@ -25,8 +25,7 @@ WORKDIR /app
25
  # Install Python deps
26
  COPY backend/requirements.txt /app/requirements.txt
27
  RUN pip install --no-cache-dir --upgrade pip && \
28
- pip install --no-cache-dir -r /app/requirements.txt && \
29
- pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
30
 
31
  # Copy app code
32
  COPY backend/ /app/
@@ -40,4 +39,4 @@ ENV PORT=7860
40
  EXPOSE 7860
41
 
42
  # Start the Flask app via gunicorn
43
- CMD ["sh", "-c", "gunicorn app:app --bind 0.0.0.0:${PORT} --workers 1 --threads 4 --timeout 300"]
 
6
  ENV TORCH_HOME=/data/torch
7
  ENV TRANSFORMERS_CACHE=/data/huggingface/hub
8
  ENV HF_DATASETS_CACHE=/data/huggingface/datasets
9
+
10
  # Create the cache directories and make them writable by any user
11
  RUN mkdir -p $TRANSFORMERS_CACHE $HF_DATASETS_CACHE $TORCH_HOME && \
12
  chmod -R 777 /data
13
 
14
  # System deps for soundfile, audio encoding, and uroman
15
  RUN apt-get update && apt-get install -y --no-install-recommends \
16
+ libsndfile1 ffmpeg git perl && \
17
  rm -rf /var/lib/apt/lists/*
18
 
19
  # Clone and install uroman from source so the tokenizer can find it
 
25
  # Install Python deps
26
  COPY backend/requirements.txt /app/requirements.txt
27
  RUN pip install --no-cache-dir --upgrade pip && \
28
+ pip install --no-cache-dir -r /app/requirements.txt
 
29
 
30
  # Copy app code
31
  COPY backend/ /app/
 
39
  EXPOSE 7860
40
 
41
  # Start the Flask app via gunicorn
42
+ CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:7860", "--workers", "1", "--threads", "4", "--timeout", "300"]