greg0rs commited on
Commit
2e98eba
·
verified ·
1 Parent(s): 4be725a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -20
Dockerfile CHANGED
@@ -1,30 +1,15 @@
1
  FROM python:3.10-slim
2
 
3
- # Set up working directory
4
- WORKDIR /app
5
-
6
- # Create writable cache directory early
7
- RUN mkdir -p /app/cache && chmod 777 /app/cache
8
-
9
- # Set environment variables to use it
10
- ENV TRANSFORMERS_CACHE=/app/cache
11
- ENV TORCH_HOME=/app/cache
12
  ENV HF_HOME=/app/cache
 
13
 
14
- # Install required tools
15
- RUN apt-get update && apt-get install -y ffmpeg wget tar && rm -rf /var/lib/apt/lists/*
16
-
17
 
18
- # Copy and install Python deps
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
- RUN mkdir -p /app/cache/nltk_data && \
23
- python -m nltk.downloader cmudict -d /app/cache/nltk_data
24
-
25
- # Copy all code
26
- COPY . .
27
 
28
- # Run the FastAPI app
29
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
30
-
 
1
  FROM python:3.10-slim
2
 
3
+ RUN mkdir -p /app/cache && chmod -R 777 /app/cache
 
 
 
 
 
 
 
 
4
  ENV HF_HOME=/app/cache
5
+ ENV TORCH_HOME=/app/cache
6
 
7
+ RUN apt-get update && apt-get install -y ffmpeg && apt-get clean && rm -rf /var/lib/apt/lists/*
 
 
8
 
 
9
  COPY requirements.txt .
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
12
+ COPY . /app
13
+ WORKDIR /app
 
 
 
14
 
 
15
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]