Fix Dockerfile
Browse files- Dockerfile +5 -1
- backend/__pycache__/main.cpython-310.pyc +0 -0
- backend/main.py +3 -3
- frontend/Dockerfile +0 -29
Dockerfile
CHANGED
|
@@ -19,6 +19,10 @@ WORKDIR /code
|
|
| 19 |
COPY --chown=user requirements.txt .
|
| 20 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
# Copy the entire project structure over
|
| 23 |
COPY --chown=user . .
|
| 24 |
|
|
@@ -26,4 +30,4 @@ COPY --chown=user . .
|
|
| 26 |
EXPOSE 7860
|
| 27 |
|
| 28 |
# Run Uvicorn pointing directly to your backend's main.py FastAPI instance
|
| 29 |
-
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 19 |
COPY --chown=user requirements.txt .
|
| 20 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 21 |
|
| 22 |
+
# βββ ADD THIS LINE TO INSTALL YOUR LOCAL PACKAGE ββββββββββββββββββ
|
| 23 |
+
# This explicitly runs 'pip install' inside the folder containing your pyproject.toml
|
| 24 |
+
RUN pip install --no-cache-dir ./backend/PvDeepSetNet
|
| 25 |
+
|
| 26 |
# Copy the entire project structure over
|
| 27 |
COPY --chown=user . .
|
| 28 |
|
|
|
|
| 30 |
EXPOSE 7860
|
| 31 |
|
| 32 |
# Run Uvicorn pointing directly to your backend's main.py FastAPI instance
|
| 33 |
+
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
backend/__pycache__/main.cpython-310.pyc
CHANGED
|
Binary files a/backend/__pycache__/main.cpython-310.pyc and b/backend/__pycache__/main.cpython-310.pyc differ
|
|
|
backend/main.py
CHANGED
|
@@ -63,6 +63,6 @@ async def predict(data: dict):
|
|
| 63 |
# This makes Dash serve as your primary visual user interface.
|
| 64 |
app.mount("/", WSGIMiddleware(dash_app.server))
|
| 65 |
|
| 66 |
-
if __name__ == "__main__":
|
| 67 |
-
|
| 68 |
-
|
|
|
|
| 63 |
# This makes Dash serve as your primary visual user interface.
|
| 64 |
app.mount("/", WSGIMiddleware(dash_app.server))
|
| 65 |
|
| 66 |
+
# if __name__ == "__main__":
|
| 67 |
+
# # Locally, you can still run this file directly
|
| 68 |
+
# uvicorn.run(app, host="127.0.0.1", port=8000)
|
frontend/Dockerfile
DELETED
|
@@ -1,29 +0,0 @@
|
|
| 1 |
-
FROM python:3.10-slim
|
| 2 |
-
|
| 3 |
-
# Install system dependencies if your ML models require compiling (optional but safe)
|
| 4 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
-
build-essential \
|
| 6 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
-
|
| 8 |
-
# Create a non-root user for Hugging Face security compliance
|
| 9 |
-
RUN useradd -m -u 1000 user
|
| 10 |
-
USER user
|
| 11 |
-
ENV PATH="/home/user/.local/bin:${PATH}"
|
| 12 |
-
|
| 13 |
-
# Force Python to look at the root directory for module imports
|
| 14 |
-
ENV PYTHONPATH="/code"
|
| 15 |
-
|
| 16 |
-
WORKDIR /code
|
| 17 |
-
|
| 18 |
-
# Copy and install requirements
|
| 19 |
-
COPY --chown=user requirements.txt .
|
| 20 |
-
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 21 |
-
|
| 22 |
-
# Copy the entire project structure over
|
| 23 |
-
COPY --chown=user . .
|
| 24 |
-
|
| 25 |
-
# Expose the mandatory Hugging Face port
|
| 26 |
-
EXPOSE 7860
|
| 27 |
-
|
| 28 |
-
# Run Uvicorn pointing directly to your backend's main.py FastAPI instance
|
| 29 |
-
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|