garyuzair commited on
Commit
200a220
Β·
verified Β·
1 Parent(s): f48142f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -21
Dockerfile CHANGED
@@ -2,35 +2,23 @@ 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 \
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
 
 
2
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && \
6
+ apt-get install -y espeak-ng && \
7
+ apt-get clean
8
+
9
+ # Explicit permissions for outputs directory
10
+ RUN mkdir -p /tmp/outputs && \
11
+ chmod 777 /tmp/outputs && \
12
+ mkdir -p /tmp/.cache && \
 
 
13
  chmod -R 777 /tmp
14
 
 
15
  COPY requirements.txt .
16
+ RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
17
 
 
18
  COPY *.py .
19
 
20
+ ENV HF_HOME=/tmp/.cache/huggingface
21
  ENV PYTHONUNBUFFERED=1
 
 
 
22
 
23
  EXPOSE 7860
24