Spaces:
Sleeping
Sleeping
Upload 3 files
Browse files- Dockerfile +17 -6
Dockerfile
CHANGED
@@ -1,18 +1,29 @@
|
|
1 |
# 1. Base image with Python
|
2 |
FROM python:3.13-slim
|
3 |
|
4 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
WORKDIR /app
|
6 |
|
7 |
# 3. Copy and install dependencies
|
8 |
COPY requirements.txt .
|
9 |
RUN pip install --no-cache-dir -r requirements.txt
|
10 |
|
11 |
-
#
|
12 |
-
COPY
|
|
|
|
|
|
|
13 |
|
14 |
-
#
|
15 |
-
|
|
|
16 |
|
17 |
# 6. Launch with Uvicorn
|
18 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "
|
|
|
1 |
# 1. Base image with Python
|
2 |
FROM python:3.13-slim
|
3 |
|
4 |
+
# Install system dependencies
|
5 |
+
RUN apt-get update && apt-get install -y \
|
6 |
+
ffmpeg \
|
7 |
+
git \
|
8 |
+
&& rm -rf /var/lib/apt/lists/*
|
9 |
+
|
10 |
+
# Create a non-root user
|
11 |
+
RUN useradd -m -u 1000 user
|
12 |
WORKDIR /app
|
13 |
|
14 |
# 3. Copy and install dependencies
|
15 |
COPY requirements.txt .
|
16 |
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
18 |
+
# Copy application files
|
19 |
+
COPY --chown=user . /app
|
20 |
+
|
21 |
+
# Switch to the non-root user
|
22 |
+
USER user
|
23 |
|
24 |
+
# Set environment variables
|
25 |
+
ENV HOME=/home/user \
|
26 |
+
PATH=/home/user/.local/bin:$PATH
|
27 |
|
28 |
# 6. Launch with Uvicorn
|
29 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|