Axzyl commited on
Commit
e0218d3
·
verified ·
1 Parent(s): 6de89fc

Upload 3 files

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -6
Dockerfile CHANGED
@@ -1,18 +1,29 @@
1
  # 1. Base image with Python
2
  FROM python:3.13-slim
3
 
4
- # 2. Set working dir
 
 
 
 
 
 
 
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
- # 4. Copy the FastAPI app
12
- COPY app.py .
 
 
 
13
 
14
- # 5. Expose port (choose 80 or any you like)
15
- EXPOSE 80
 
16
 
17
  # 6. Launch with Uvicorn
18
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "80"]
 
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"]