Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +13 -18
Dockerfile
CHANGED
|
@@ -1,29 +1,24 @@
|
|
| 1 |
-
# Use the base image directly
|
| 2 |
FROM ghcr.io/meta-pytorch/openenv-base:latest
|
| 3 |
|
| 4 |
-
# Set
|
| 5 |
-
WORKDIR /
|
| 6 |
|
| 7 |
-
# Install
|
| 8 |
-
RUN apt-get update &&
|
| 9 |
-
apt-get install -y --no-install-recommends git && \
|
| 10 |
-
rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
-
# Copy all files from
|
| 13 |
-
COPY .
|
| 14 |
|
| 15 |
-
# Install dependencies
|
| 16 |
-
# This avoids all virtual environment pathing headaches
|
| 17 |
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
| 18 |
/root/.local/bin/uv pip install --system fastapi uvicorn httpx openai openenv
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
ENV PYTHONPATH="/
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
|
| 25 |
-
CMD curl -f http://localhost:7860/health || exit 1
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
#
|
| 29 |
CMD ["python3", "-m", "uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
| 1 |
FROM ghcr.io/meta-pytorch/openenv-base:latest
|
| 2 |
|
| 3 |
+
# Set the working directory
|
| 4 |
+
WORKDIR /workspace
|
| 5 |
|
| 6 |
+
# Install system dependencies
|
| 7 |
+
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
# Copy all files from the repo to the current directory (/workspace)
|
| 10 |
+
COPY . .
|
| 11 |
|
| 12 |
+
# Install dependencies to system python
|
|
|
|
| 13 |
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
| 14 |
/root/.local/bin/uv pip install --system fastapi uvicorn httpx openai openenv
|
| 15 |
|
| 16 |
+
# Force the PYTHONPATH to be the current directory
|
| 17 |
+
ENV PYTHONPATH="/workspace"
|
| 18 |
|
| 19 |
+
# Expose the port
|
| 20 |
+
EXPOSE 7860
|
|
|
|
| 21 |
|
| 22 |
+
# Run uvicorn.
|
| 23 |
+
# We use the full path to uvicorn to ensure it's found.
|
| 24 |
CMD ["python3", "-m", "uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]
|