thisisgini commited on
Commit
22cd090
·
verified ·
1 Parent(s): 7623013

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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 workdir to the root of your app
5
- WORKDIR /app
6
 
7
- # Install git and clean up
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 your repo into /app
13
- COPY . /app
14
 
15
- # Install dependencies directly to the system python
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
- # Explicitly set PYTHONPATH so it can see the 'server' folder in /app
21
- ENV PYTHONPATH="/app"
22
 
23
- # Health check
24
- HEALTHCHECK --interval=30s --timeout=30s --start-period=10s --retries=3 \
25
- CMD curl -f http://localhost:7860/health || exit 1
26
 
27
- # Start the app using the direct path
28
- # Since we are in /app, and app.py is in /app/server/app.py
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"]