NitinBot001 commited on
Commit
b226bb6
·
verified ·
1 Parent(s): 21a158f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -23
Dockerfile CHANGED
@@ -1,33 +1,32 @@
1
- # Use an official Python runtime as a parent image
2
- FROM python:3.10-slim
3
 
4
- # Set the working directory in the container
5
- WORKDIR /app
6
-
7
- # Install system dependencies required for llama-cpp-python
8
  RUN apt-get update && apt-get install -y \
9
- build-essential \
10
- cmake \
11
- git \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # Copy the requirements file into the container
15
- COPY requirements.txt .
16
 
17
- # Install Python dependencies
18
- RUN pip install --no-cache-dir -r requirements.txt gunicorn
 
19
 
20
- # Install Node.js and nport
21
- RUN apt-get update && apt-get install -y curl && \
22
- curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
23
- apt-get install -y nodejs && \
24
- npm install -g nport
25
 
26
- # Copy the application code into the container
27
- COPY app.py .
28
 
29
- # Expose port 7860 for the Flask app
30
  EXPOSE 7860
31
 
32
- # Command to run the application using Gunicorn
33
- CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
 
 
 
 
 
 
 
1
+ # Dockerfile
2
+ FROM python:3.11-slim
3
 
4
+ # Install system dependencies for audio processing
 
 
 
5
  RUN apt-get update && apt-get install -y \
6
+ ffmpeg \
 
 
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
+ # Set working directory
10
+ WORKDIR /app
11
 
12
+ # Copy requirements and install Python dependencies
13
+ COPY requirements.txt .
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
 
16
+ # Copy application code
17
+ COPY gemini_tts_api.py .
 
 
 
18
 
19
+ # Create directory for audio files
20
+ RUN mkdir -p audio_files
21
 
22
+ # Expose port
23
  EXPOSE 7860
24
 
25
+ # Set environment variables
26
+ ENV PYTHONUNBUFFERED=1
27
+ ENV GEMINI_API_KEY=""
28
+ ENV GEMINI_API_KEYS=""
29
+ # Support for individual API keys: GEMINI_API_KEY_1, GEMINI_API_KEY_2, etc.
30
+
31
+ # Run the application
32
+ CMD ["uvicorn", "gemini_tts_api:app", "--host", "0.0.0.0", "--port", "7860"]