Hameed13 commited on
Commit
cf42333
·
verified ·
1 Parent(s): 489daff

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -20
Dockerfile CHANGED
@@ -1,32 +1,28 @@
1
  FROM python:3.10
2
 
 
 
3
  # Install system dependencies
4
  RUN apt-get update && apt-get install -y \
5
  wget \
6
- git \
7
- ffmpeg \
8
- libsndfile1 \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Create a non-root user
12
- RUN useradd -m -u 1000 user
13
- USER user
14
- ENV PATH="/home/user/.local/bin:$PATH"
15
-
16
- WORKDIR /app
17
 
18
- # Copy requirements file
19
- COPY --chown=user ./requirements.txt requirements.txt
20
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
21
 
22
- # Create necessary directories
23
- RUN mkdir -p /app/audio_files /app/models
24
 
25
- # Copy application code
26
- COPY --chown=user . /app
27
 
28
- # Make directories writable by the user
29
- RUN chmod -R 755 /app/audio_files /app/models
30
 
31
- # Run the application
32
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10
2
 
3
+ WORKDIR /app
4
+
5
  # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
  wget \
8
+ curl \
 
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Copy requirements and install them first to utilize Docker caching
12
+ COPY requirements.txt .
13
+ RUN pip install --no-cache-dir -r requirements.txt
 
 
 
14
 
15
+ # Copy all application files
16
+ COPY . .
 
17
 
18
+ # Make directories for models if they don't exist
19
+ RUN mkdir -p models
20
 
21
+ # Set environment variables
22
+ ENV PYTHONUNBUFFERED=1
23
 
24
+ # Expose port
25
+ EXPOSE 7860
26
 
27
+ # Run app.py as the entry point
28
+ CMD ["python", "app.py"]