ygauravyy commited on
Commit
587ebe6
1 Parent(s): fff6648

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -9
Dockerfile CHANGED
@@ -5,21 +5,23 @@ ENV PYTHONDONTWRITEBYTECODE=1
5
  ENV PYTHONUNBUFFERED=1
6
  ENV PORT=7860
7
 
 
 
 
 
 
 
 
8
  # Create a non-root user
9
  RUN useradd -m -u 1000 user
 
 
10
  USER user
11
  ENV PATH="/home/user/.local/bin:$PATH"
12
 
13
  WORKDIR /app
14
 
15
- # Install system dependencies
16
- RUN apt-get update && apt-get install -y \
17
- build-essential \
18
- libsndfile1 \
19
- ffmpeg \
20
- && rm -rf /var/lib/apt/lists/*
21
-
22
- # Copy requirements and install Python dependencies
23
  COPY --chown=user:users requirements.txt /app/requirements.txt
24
  RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt
25
 
@@ -29,7 +31,7 @@ COPY --chown=user:users . /app
29
  # Ensure outputs and temp directories exist
30
  RUN mkdir -p outputs temp
31
 
32
- # Expose port 7860
33
  EXPOSE 7860
34
 
35
  # Run the application
 
5
  ENV PYTHONUNBUFFERED=1
6
  ENV PORT=7860
7
 
8
+ # Install system dependencies as root
9
+ RUN apt-get update && apt-get install -y \
10
+ build-essential \
11
+ libsndfile1 \
12
+ ffmpeg \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
  # Create a non-root user
16
  RUN useradd -m -u 1000 user
17
+
18
+ # Switch to the non-root user
19
  USER user
20
  ENV PATH="/home/user/.local/bin:$PATH"
21
 
22
  WORKDIR /app
23
 
24
+ # Install Python dependencies
 
 
 
 
 
 
 
25
  COPY --chown=user:users requirements.txt /app/requirements.txt
26
  RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt
27
 
 
31
  # Ensure outputs and temp directories exist
32
  RUN mkdir -p outputs temp
33
 
34
+ # Expose the application port
35
  EXPOSE 7860
36
 
37
  # Run the application