Spaces:
Sleeping
Sleeping
Dockerfile added
Browse files- Dockerfile +18 -0
- template.py +1 -0
Dockerfile
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official Python runtime as the base image
|
2 |
+
FROM python:3.10
|
3 |
+
|
4 |
+
# Set the working directory
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Copy the entire project into the container
|
8 |
+
COPY . /app
|
9 |
+
|
10 |
+
# Install dependencies
|
11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
+
|
13 |
+
# Expose ports for FastAPI (8000) and Streamlit (7860)
|
14 |
+
EXPOSE 8000
|
15 |
+
EXPOSE 7860
|
16 |
+
|
17 |
+
# Start both FastAPI and Streamlit
|
18 |
+
CMD ["sh", "-c", "uvicorn api:app --host 0.0.0.0 --port 8000 & streamlit run app.py --server.port 7860 --server.address 0.0.0.0"]
|
template.py
CHANGED
@@ -14,6 +14,7 @@ list_of_files = [
|
|
14 |
'requirements.txt',
|
15 |
'setup.py',
|
16 |
'research/trials.ipynb',
|
|
|
17 |
]
|
18 |
|
19 |
for filepath in list_of_files:
|
|
|
14 |
'requirements.txt',
|
15 |
'setup.py',
|
16 |
'research/trials.ipynb',
|
17 |
+
'Dockerfile'
|
18 |
]
|
19 |
|
20 |
for filepath in list_of_files:
|