Kartikeyssj2 commited on
Commit
d3c1426
1 Parent(s): 2642248
Files changed (1) hide show
  1. Dockerfile +19 -8
Dockerfile CHANGED
@@ -1,15 +1,26 @@
1
- FROM python:3.11.7
 
2
 
3
- RUN useradd -m -u 1000 user
4
- USER user
5
- ENV PATH="/home/user/.local/bin:$PATH"
6
 
 
 
7
 
8
- COPY --chown=user ./requirements.txt requirements.txt
9
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
 
 
 
 
10
 
11
  RUN python download_models.py
 
 
12
  ENV TRANSFORMERS_CACHE=/tmp/.cache
13
 
14
- COPY --chown=user . /app
15
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.11.7-slim
3
 
4
+ # Set the working directory in the container
5
+ WORKDIR /app
 
6
 
7
+ # Copy the current directory contents into the container at /app
8
+ COPY . /app
9
 
10
+ # Install system dependencies
11
+ RUN apt-get update && apt-get install -y \
12
+ libsndfile1 \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # Install any needed packages specified in requirements.txt
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
 
18
  RUN python download_models.py
19
+
20
+ # Define environment variable
21
  ENV TRANSFORMERS_CACHE=/tmp/.cache
22
 
23
+ # Run app.py when the container launches
24
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
25
+
26
+