Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +4 -7
Dockerfile
CHANGED
|
@@ -1,18 +1,17 @@
|
|
| 1 |
# Use the official Python 3.12 Alpine image as the base
|
| 2 |
FROM python:3.12-alpine
|
| 3 |
|
| 4 |
-
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
# Install required system packages
|
| 8 |
-
RUN
|
| 9 |
|
| 10 |
# Create a non-root user
|
| 11 |
-
RUN
|
| 12 |
|
| 13 |
# Copy requirements and install Python packages
|
| 14 |
COPY requirements.txt .
|
| 15 |
-
RUN pip install -
|
| 16 |
|
| 17 |
# Copy the application files
|
| 18 |
COPY . .
|
|
@@ -26,8 +25,6 @@ RUN find /app -type f -exec chmod 644 {} \; && \
|
|
| 26 |
# Switch to non-root user
|
| 27 |
USER appuser
|
| 28 |
|
| 29 |
-
# Expose the application port
|
| 30 |
EXPOSE 7860
|
| 31 |
|
| 32 |
-
|
| 33 |
-
CMD ["python", "srv.py"]
|
|
|
|
| 1 |
# Use the official Python 3.12 Alpine image as the base
|
| 2 |
FROM python:3.12-alpine
|
| 3 |
|
|
|
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
# Install required system packages
|
| 7 |
+
RUN apt-get update && apt-get install -y ffmpeg
|
| 8 |
|
| 9 |
# Create a non-root user
|
| 10 |
+
RUN useradd -m -u 1000 appuser
|
| 11 |
|
| 12 |
# Copy requirements and install Python packages
|
| 13 |
COPY requirements.txt .
|
| 14 |
+
RUN pip install -r requirements.txt
|
| 15 |
|
| 16 |
# Copy the application files
|
| 17 |
COPY . .
|
|
|
|
| 25 |
# Switch to non-root user
|
| 26 |
USER appuser
|
| 27 |
|
|
|
|
| 28 |
EXPOSE 7860
|
| 29 |
|
| 30 |
+
CMD ["python", "srv.py"]
|
|
|