Hameed13 commited on
Commit
e2b585e
·
verified ·
1 Parent(s): 7e04f7a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -10
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM python:3.9-slim
2
 
3
  WORKDIR /code
4
 
@@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y \
8
  libsndfile1 \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Create directories with proper permissions
12
  RUN mkdir -p /code/cache && \
13
  mkdir -p /code/models && \
14
  mkdir -p /code/audio_files && \
@@ -16,19 +16,16 @@ RUN mkdir -p /code/cache && \
16
 
17
  # Copy requirements first to leverage Docker cache
18
  COPY ./requirements.txt /code/requirements.txt
 
 
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
  # Copy the rest of the application
22
- COPY . /code
23
-
24
- # Ensure proper permissions after copying
25
- RUN chmod -R 777 /code/cache \
26
- && chmod -R 777 /code/models \
27
- && chmod -R 777 /code/audio_files
28
 
29
  # Set environment variables
 
 
30
  ENV HF_HOME=/code/cache
31
- ENV TRANSFORMERS_CACHE=/code/cache/transformers
32
 
33
- # Command to run the application
34
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.10-slim
2
 
3
  WORKDIR /code
4
 
 
8
  libsndfile1 \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Create required directories
12
  RUN mkdir -p /code/cache && \
13
  mkdir -p /code/models && \
14
  mkdir -p /code/audio_files && \
 
16
 
17
  # Copy requirements first to leverage Docker cache
18
  COPY ./requirements.txt /code/requirements.txt
19
+
20
+ # Install Python dependencies
21
  RUN pip install --no-cache-dir -r requirements.txt
22
 
23
  # Copy the rest of the application
24
+ COPY . .
 
 
 
 
 
25
 
26
  # Set environment variables
27
+ ENV PYTHONPATH=/code
28
+ ENV TRANSFORMERS_CACHE=/code/cache
29
  ENV HF_HOME=/code/cache
 
30
 
 
31
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]