deepak191z commited on
Commit
45098cb
·
verified ·
1 Parent(s): de6bd9e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -21
Dockerfile CHANGED
@@ -1,27 +1,15 @@
1
- # Use a Python 3.10 Slim image as the base
2
- FROM python:3.10-slim
3
 
4
- # Set the working directory
5
- WORKDIR /code
6
 
7
- # Install virtualenv to create a virtual environment
8
- RUN pip install --no-cache-dir virtualenv
9
 
10
- # Create and activate the virtual environment
11
- RUN python -m venv /code/venv
12
 
13
- # Ensure the virtual environment is used for subsequent pip installations
14
- ENV PATH="/code/venv/bin:$PATH"
15
 
16
- # Copy the requirements file to the container
17
- COPY ./requirements.txt /code/requirements.txt
18
 
19
- # Install dependencies inside the virtual environment
20
- RUN pip install --no-cache-dir --upgrade pip && \
21
- pip install --no-cache-dir -r /code/requirements.txt
22
-
23
- # Copy the rest of the project files into the container
24
- COPY . .
25
-
26
- # Set the default command to run your application (inside the virtual environment)
27
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.13-slim
 
2
 
3
+ WORKDIR /app
 
4
 
5
+ RUN python3 -m venv /app/venv
6
+ ENV PATH="/app/venv/bin:$PATH"
7
 
8
+ COPY requirements.txt /app/
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
 
11
+ COPY . /app
 
12
 
13
+ EXPOSE 8080
 
14
 
15
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]