Johnniewhite commited on
Commit
d6d2ef0
·
verified ·
1 Parent(s): 2116489

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -3
Dockerfile CHANGED
@@ -4,8 +4,18 @@ WORKDIR /code
4
 
5
  COPY ./requirements.txt /code/requirements.txt
6
 
7
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
8
 
9
- COPY . .
 
10
 
11
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
4
 
5
  COPY ./requirements.txt /code/requirements.txt
6
 
7
+ # 4. Install dependencies
8
+ RUN pip install -r requirements.txt
9
 
10
+ # 5. Optionally install TensorFlow for GPU support (if available)
11
+ RUN if [ $(command -v nvidia-smi) ]; then pip install tensorflow-gpu; else pip install tensorflow; fi
12
 
13
+ # 6. Copy application code
14
+ COPY index.py ./
15
+
16
+ # 7. Expose port for Flask app
17
+ EXPOSE 5000
18
+
19
+ # 8. Start the Flask app
20
+ CMD ["python", "index.py"]
21
+ CMD ["uvicorn", "index:app", "--host", "0.0.0.0", "--port", "7860"]