Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +7 -10
Dockerfile
CHANGED
|
@@ -5,23 +5,20 @@ WORKDIR /app
|
|
| 5 |
# 1. Install system tools
|
| 6 |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
-
# 2.
|
| 9 |
-
# This ensures 'setuptools.build-meta' is present before the project install
|
| 10 |
RUN pip install --no-cache-dir --upgrade pip
|
| 11 |
-
RUN pip install --no-cache-dir setuptools
|
| 12 |
|
| 13 |
-
# 3.
|
| 14 |
RUN pip install --no-cache-dir fastapi uvicorn pydantic "openenv-core>=0.2.0"
|
| 15 |
|
| 16 |
-
# 4. Copy
|
| 17 |
COPY . .
|
| 18 |
|
| 19 |
-
# 5.
|
| 20 |
-
# We remove --no-build-isolation to let pip use the global tools we just installed
|
| 21 |
-
RUN pip install --no-cache-dir -e .
|
| 22 |
-
|
| 23 |
ENV PYTHONPATH=/app
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
-
# 6. Run the
|
|
|
|
| 27 |
CMD ["python", "-m", "server.app"]
|
|
|
|
| 5 |
# 1. Install system tools
|
| 6 |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
+
# 2. Install the tools GLOBALLY
|
|
|
|
| 9 |
RUN pip install --no-cache-dir --upgrade pip
|
| 10 |
+
RUN pip install --no-cache-dir setuptools wheel uv
|
| 11 |
|
| 12 |
+
# 3. Install dependencies directly (This bypasses the pyproject.toml build hook)
|
| 13 |
RUN pip install --no-cache-dir fastapi uvicorn pydantic "openenv-core>=0.2.0"
|
| 14 |
|
| 15 |
+
# 4. Copy your files (This satisfies Scaler's uv.lock requirement)
|
| 16 |
COPY . .
|
| 17 |
|
| 18 |
+
# 5. Set environment variables so Python can find your 'server' and 'env' folders
|
|
|
|
|
|
|
|
|
|
| 19 |
ENV PYTHONPATH=/app
|
| 20 |
EXPOSE 7860
|
| 21 |
|
| 22 |
+
# 6. Run the app directly as a module
|
| 23 |
+
# This works because we set PYTHONPATH and have __init__.py files
|
| 24 |
CMD ["python", "-m", "server.app"]
|