bitsnaps commited on
Commit
0b3952c
·
verified ·
1 Parent(s): 522e547

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -0
Dockerfile ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies including ffmpeg
6
+ RUN apt-get update && apt-get install -y \
7
+ ffmpeg \
8
+ libsndfile1 \
9
+ build-essential \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Copy requirements first to leverage Docker cache
13
+ COPY requirements.txt .
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
+
16
+ # Copy application code
17
+ COPY . .
18
+
19
+ # Create necessary directories
20
+ RUN mkdir -p uploads
21
+
22
+ # Set environment variables
23
+ ENV PYTHONDONTWRITEBYTECODE=1
24
+ ENV PYTHONUNBUFFERED=1
25
+ ENV PORT=8000
26
+
27
+ # Expose the port the app runs on
28
+ EXPOSE 8000
29
+
30
+ # Command to run the application
31
+ CMD gunicorn main:app --workers 4 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:$PORT