deepak191z commited on
Commit
25b87a9
·
verified ·
1 Parent(s): 0dfa582

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -13
Dockerfile CHANGED
@@ -1,21 +1,18 @@
1
- FROM python:3.10-alpine
 
2
 
3
- # Set working directory
4
  WORKDIR /code
5
 
6
- # Install build dependencies first (because Alpine is minimal)
7
- RUN apk add --no-cache --virtual .build-deps \
8
- gcc musl-dev libffi-dev make
9
-
10
- # Install Python dependencies
11
  COPY ./requirements.txt /code/requirements.txt
12
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
13
 
14
- # Copy app files
15
- COPY . .
 
16
 
17
- # Remove build dependencies to make final image lighter
18
- RUN apk del .build-deps
19
 
20
- # Command to run your app
21
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use a Python 3.10 Slim image as the base
2
+ FROM python:3.10-slim
3
 
4
+ # Set the working directory in the container
5
  WORKDIR /code
6
 
7
+ # Copy the requirements file to the container
 
 
 
 
8
  COPY ./requirements.txt /code/requirements.txt
 
9
 
10
+ # Upgrade pip to the latest version and install the dependencies
11
+ RUN pip install --no-cache-dir --upgrade pip && \
12
+ pip install --no-cache-dir -r /code/requirements.txt
13
 
14
+ # Copy the rest of the project files into the container
15
+ COPY . .
16
 
17
+ # Set the default command to run your application
18
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]