Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +3 -13
Dockerfile
CHANGED
|
@@ -1,26 +1,16 @@
|
|
| 1 |
FROM ghcr.io/meta-pytorch/openenv-base:latest
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
-
|
| 5 |
-
# Install system dependencies
|
| 6 |
-
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
| 7 |
-
|
| 8 |
-
# Copy all your files into /app
|
| 9 |
COPY . /app
|
| 10 |
|
| 11 |
-
|
| 12 |
-
# This ensures a folder named 'server' exists and puts app.py inside it,
|
| 13 |
-
# regardless of where it is in your GitHub repo.
|
| 14 |
-
RUN mkdir -p /app/server && \
|
| 15 |
-
cp /app/app.py /app/server/app.py || true && \
|
| 16 |
-
touch /app/server/__init__.py
|
| 17 |
|
| 18 |
-
# Install dependencies
|
| 19 |
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
| 20 |
/root/.local/bin/uv pip install --system fastapi uvicorn httpx openai openenv
|
| 21 |
|
|
|
|
| 22 |
ENV PYTHONPATH="/app"
|
| 23 |
EXPOSE 7860
|
| 24 |
|
| 25 |
-
#
|
| 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 |
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
COPY . /app
|
| 5 |
|
| 6 |
+
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
|
|
|
| 8 |
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
| 9 |
/root/.local/bin/uv pip install --system fastapi uvicorn httpx openai openenv
|
| 10 |
|
| 11 |
+
# This tells Python to treat /app as the home base for all imports
|
| 12 |
ENV PYTHONPATH="/app"
|
| 13 |
EXPOSE 7860
|
| 14 |
|
| 15 |
+
# We run from the root, targeting the folder specifically
|
| 16 |
CMD ["python3", "-m", "uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]
|