File size: 520 Bytes
62a1dd1
 
 
 
 
 
d6d2ef0
 
62a1dd1
d6d2ef0
 
62a1dd1
d6d2ef0
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM python:3.9

WORKDIR /code

COPY ./requirements.txt /code/requirements.txt

# 4. Install dependencies
RUN pip install -r requirements.txt

# 5. Optionally install TensorFlow for GPU support (if available)
RUN if [ $(command -v nvidia-smi) ]; then pip install tensorflow-gpu; else pip install tensorflow; fi

# 6. Copy application code
COPY index.py ./

# 7. Expose port for Flask app
EXPOSE 5000

# 8. Start the Flask app
CMD ["python", "index.py"]
CMD ["uvicorn", "index:app", "--host", "0.0.0.0", "--port", "7860"]