AyushS9020 commited on
Commit
86140bc
·
verified ·
1 Parent(s): 0f7e22b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -17
Dockerfile CHANGED
@@ -1,22 +1,13 @@
1
- # Use an official Python runtime as a parent image
2
- FROM python:3.9-slim
3
 
4
- # Install dependencies required by PyTorch and torchaudio
5
- RUN apt-get update && apt-get install -y \
6
- libgomp1 \
7
- && rm -rf /var/lib/apt/lists/*
8
 
9
- # Set the working directory in the container
10
  WORKDIR /app
11
 
12
- # Copy the current directory contents into the container at /app
13
- COPY . /app
14
 
15
- # Install any needed packages specified in requirements.txt
16
- RUN pip install --no-cache-dir -r requirements.txt
17
-
18
- # Expose port 8000 to the outside world
19
- EXPOSE 8000
20
-
21
- # Run the FastAPI app using python app.py
22
- CMD ["python", "app.py"]
 
1
+ FROM python:3.9
 
2
 
3
+ RUN useradd -m -u 1000 user
4
+ USER user
5
+ ENV PATH="/home/user/.local/bin:$PATH"
 
6
 
 
7
  WORKDIR /app
8
 
9
+ COPY --chown=user ./requirements.txt requirements.txt
10
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
11
 
12
+ COPY --chown=user . /app
13
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]