thisisgini commited on
Commit
dfb2be2
·
verified ·
1 Parent(s): ae37163

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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 (standard for these environments)
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 to /app
10
- COPY . .
 
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
- # CRITICAL: This allows 'server.app' to be found and
18
- # allows 'app.py' to import 'inference.py' from the root.
19
  ENV PYTHONPATH="/app"
20
 
21
- # Open the port Hugging Face uses
22
  EXPOSE 7860
23
 
24
- # Updated CMD to point to the server folder as required by the validator
25
- # This runs the 'app' object inside 'server/app.py'
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"]