Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +13 -3
Dockerfile
CHANGED
|
@@ -4,8 +4,18 @@ WORKDIR /code
|
|
| 4 |
|
| 5 |
COPY ./requirements.txt /code/requirements.txt
|
| 6 |
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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"]
|