Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +9 -10
Dockerfile
CHANGED
|
@@ -1,26 +1,25 @@
|
|
| 1 |
FROM ghcr.io/meta-pytorch/openenv-base:latest
|
| 2 |
|
| 3 |
-
# Set the working directory to /app
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
# Install system dependencies
|
| 7 |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
-
# Copy everything
|
| 10 |
-
|
|
|
|
| 11 |
|
| 12 |
-
# Install dependencies
|
| 13 |
-
# Added '-r requirements.txt' to ensure any additional project libs are included
|
| 14 |
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
| 15 |
/root/.local/bin/uv pip install --system fastapi uvicorn httpx openai openenv
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
# allows 'app.py' to import 'inference.py' from the root.
|
| 19 |
ENV PYTHONPATH="/app"
|
| 20 |
|
| 21 |
-
#
|
| 22 |
EXPOSE 7860
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
# This
|
| 26 |
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 to /app
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
# Install system dependencies
|
| 7 |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
+
# Copy everything from your repo into /app
|
| 10 |
+
# This ensures /app/server/app.py exists
|
| 11 |
+
COPY . /app
|
| 12 |
|
| 13 |
+
# Install dependencies
|
|
|
|
| 14 |
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
| 15 |
/root/.local/bin/uv pip install --system fastapi uvicorn httpx openai openenv
|
| 16 |
|
| 17 |
+
# Force Python to look at the root directory for modules
|
|
|
|
| 18 |
ENV PYTHONPATH="/app"
|
| 19 |
|
| 20 |
+
# Expose the correct port
|
| 21 |
EXPOSE 7860
|
| 22 |
|
| 23 |
+
# We use the relative path from the WORKDIR
|
| 24 |
+
# This tells uvicorn: "Look in the 'server' folder for 'app.py' and the 'app' variable"
|
| 25 |
CMD ["python3", "-m", "uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]
|