Spaces:
Build error
Build error
mohsinabbas1984
commited on
Create Dockerfile
Browse files- Dockerfile +25 -0
Dockerfile
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official Python runtime as a parent image
|
2 |
+
FROM python:3.9
|
3 |
+
|
4 |
+
# Set the working directory to /app
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Copy the backend requirements file and install any needed packages
|
8 |
+
COPY backend/requirements.txt /app/backend/requirements.txt
|
9 |
+
RUN pip install --no-cache-dir -r /app/backend/requirements.txt
|
10 |
+
|
11 |
+
# Copy the backend code
|
12 |
+
COPY backend /app/backend
|
13 |
+
|
14 |
+
# Copy the frontend requirements file and install any needed packages
|
15 |
+
COPY frontend/requirements.txt /app/frontend/requirements.txt
|
16 |
+
RUN pip install --no-cache-dir -r /app/frontend/requirements.txt
|
17 |
+
|
18 |
+
# Copy the frontend code
|
19 |
+
COPY frontend /app/frontend
|
20 |
+
|
21 |
+
# Expose necessary ports
|
22 |
+
EXPOSE 8000 8501
|
23 |
+
|
24 |
+
# Start both services using a script
|
25 |
+
CMD ["bash", "-c", "uvicorn backend.main:app --host 0.0.0.0 --port 8000 & streamlit run /app/frontend/app.py"]
|