darpanaswal commited on
Commit
7bddc94
·
verified ·
1 Parent(s): cc2e3f2

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -4
Dockerfile CHANGED
@@ -1,15 +1,26 @@
 
1
  FROM python:3.8
2
 
 
3
  WORKDIR /code
4
 
5
- # Upgrade pip to the latest version
6
- RUN pip install --no-cache-dir --upgrade pip
7
 
8
- # Ensure this COPY command matches the location of the dlib wheel file
 
 
 
 
 
 
9
  COPY ./requirements.txt /code/
10
 
 
11
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
12
 
 
13
  COPY . .
14
 
15
- CMD ["python", "/code/app.py", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ # Use the official Python 3.8 base image
2
  FROM python:3.8
3
 
4
+ # Set the working directory in the container
5
  WORKDIR /code
6
 
7
+ # Install virtualenv
8
+ RUN pip install --no-cache-dir --upgrade pip virtualenv
9
 
10
+ # Create a virtual environment
11
+ RUN python -m virtualenv venv
12
+
13
+ # Activate the virtual environment
14
+ ENV PATH="/code/venv/bin:$PATH"
15
+
16
+ # Copy requirements file to the container
17
  COPY ./requirements.txt /code/
18
 
19
+ # Install dependencies in the virtual environment
20
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
21
 
22
+ # Copy the rest of your application's code to the container
23
  COPY . .
24
 
25
+ # Command to run your application
26
+ CMD ["python", "/code/app.py", "--host", "0.0.0.0", "--port", "7860"]