Spaces:
Sleeping
Sleeping
fixed docker issues
Browse files- Dockerfile +9 -4
Dockerfile
CHANGED
@@ -7,10 +7,9 @@ ENV PORT=8080
|
|
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 |
-
|
|
|
14 |
|
15 |
# Install system dependencies
|
16 |
RUN apt-get update && apt-get install -y \
|
@@ -19,6 +18,12 @@ RUN apt-get update && apt-get install -y \
|
|
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
|
@@ -33,4 +38,4 @@ RUN mkdir -p outputs temp
|
|
33 |
EXPOSE 8080
|
34 |
|
35 |
# Run the application
|
36 |
-
CMD ["python", "app.py"]
|
|
|
7 |
|
8 |
# Create a non-root user
|
9 |
RUN useradd -m -u 1000 user
|
|
|
|
|
10 |
|
11 |
+
# Switch to root for system installations
|
12 |
+
USER root
|
13 |
|
14 |
# Install system dependencies
|
15 |
RUN apt-get update && apt-get install -y \
|
|
|
18 |
ffmpeg \
|
19 |
&& rm -rf /var/lib/apt/lists/*
|
20 |
|
21 |
+
# Switch back to non-root user
|
22 |
+
USER user
|
23 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
24 |
+
|
25 |
+
WORKDIR /app
|
26 |
+
|
27 |
# Copy requirements and install Python dependencies
|
28 |
COPY --chown=user:users requirements.txt /app/requirements.txt
|
29 |
RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
|
|
38 |
EXPOSE 8080
|
39 |
|
40 |
# Run the application
|
41 |
+
CMD ["python", "app.py"]
|