Create Dockerfile
Browse files- Dockerfile +24 -0
Dockerfile
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# Install dependencies
|
| 6 |
+
COPY requirements.txt .
|
| 7 |
+
RUN pip install -r requirements.txt
|
| 8 |
+
|
| 9 |
+
# Copy your application code
|
| 10 |
+
COPY src/ /app/
|
| 11 |
+
|
| 12 |
+
# Expose both ports (7860 for Streamlit, 8000 for FastAPI)
|
| 13 |
+
EXPOSE 8501
|
| 14 |
+
EXPOSE 8000
|
| 15 |
+
|
| 16 |
+
# Create a script to run both services
|
| 17 |
+
RUN echo '#!/bin/bash\n\
|
| 18 |
+
streamlit run app.py --server.port 8501 --server.address 0.0.0.0 & \n\
|
| 19 |
+
uvicorn response_api:app --host 0.0.0.0 --port 8000\n\
|
| 20 |
+
' > /app/start.sh
|
| 21 |
+
|
| 22 |
+
RUN chmod +x /app/start.sh
|
| 23 |
+
|
| 24 |
+
CMD ["/app/start.sh"]
|