garyuzair commited on
Commit
4792fe1
Β·
verified Β·
1 Parent(s): 3a37861

Update Dockerfile

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