garyuzair commited on
Commit
3a37861
Β·
verified Β·
1 Parent(s): 8d7023c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -13
Dockerfile CHANGED
@@ -2,7 +2,7 @@ FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
- # System setup
6
  RUN apt-get update && \
7
  apt-get install -y --no-install-recommends \
8
  espeak-ng \
@@ -10,25 +10,21 @@ RUN apt-get update && \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
  # Create writable directories
13
- RUN mkdir -p /.cache && \
14
- mkdir -p /.local && \
15
- chmod -R 777 /.cache && \
16
- chmod -R 777 /.local
17
  RUN mkdir -p /tmp/outputs && \
18
- chmod -R 777 /tmp/outputs
19
- # Install Python dependencies with explicit versions
 
 
20
  COPY requirements.txt .
21
  RUN pip install --no-cache-dir -r requirements.txt
22
 
23
- # Install spaCy model
24
- RUN python -m spacy download en_core_web_sm
25
-
26
- # Copy application files
27
  COPY *.py .
28
 
29
- # Environment variables
30
  ENV PYTHONUNBUFFERED=1
31
- ENV HF_HOME=/.cache/huggingface
 
32
 
33
  EXPOSE 7860
34
 
 
2
 
3
  WORKDIR /app
4
 
5
+ # System dependencies
6
  RUN apt-get update && \
7
  apt-get install -y --no-install-recommends \
8
  espeak-ng \
 
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
  # Create writable directories
 
 
 
 
13
  RUN mkdir -p /tmp/outputs && \
14
+ mkdir -p /tmp/.cache/huggingface && \
15
+ chmod -R 777 /tmp
16
+
17
+ # Python dependencies
18
  COPY requirements.txt .
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
+ # Application files
 
 
 
22
  COPY *.py .
23
 
24
+ # Environment configuration
25
  ENV PYTHONUNBUFFERED=1
26
+ ENV HF_HOME=/tmp/.cache/huggingface
27
+ ENV TRANSFORMERS_CACHE=/tmp/.cache/huggingface
28
 
29
  EXPOSE 7860
30