Spaces:
Sleeping
Sleeping
Commit
·
56531d1
1
Parent(s):
4a3521a
backend deploymemt
Browse files- Dockerfile +6 -12
Dockerfile
CHANGED
@@ -8,20 +8,14 @@ WORKDIR /app
|
|
8 |
COPY . /app
|
9 |
|
10 |
# Install dependencies
|
11 |
-
|
12 |
RUN pip install -r requirement.txt
|
13 |
|
14 |
-
#
|
15 |
-
|
16 |
-
|
17 |
-
# Ensure logs directory exists
|
18 |
-
RUN mkdir -p /app/logs && chmod -R 777 /app/logs
|
19 |
|
20 |
-
#
|
21 |
-
|
22 |
-
|
23 |
-
# Start FastAPI & Streamlit together using tmux
|
24 |
-
# CMD ["sh", "-c", "tmux new-session -d -s fastapi 'uvicorn backend.main:app --host 0.0.0.0 --port 7860' && streamlit run Frontend/app.py --server.port 7860 --server.address 0.0.0.0"]
|
25 |
|
26 |
-
#
|
27 |
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|
8 |
COPY . /app
|
9 |
|
10 |
# Install dependencies
|
11 |
+
RUN pip install --upgrade pip
|
12 |
RUN pip install -r requirement.txt
|
13 |
|
14 |
+
# Set PYTHONPATH so FastAPI can find the 'backend' module
|
15 |
+
ENV PYTHONPATH=/app
|
|
|
|
|
|
|
16 |
|
17 |
+
# Expose the required port
|
18 |
+
EXPOSE 8000
|
|
|
|
|
|
|
19 |
|
20 |
+
# Start FastAPI with the correct module path
|
21 |
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]
|