thisisgini commited on
Commit
95b310b
·
verified ·
1 Parent(s): 26de7b6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -5
Dockerfile CHANGED
@@ -2,20 +2,25 @@ FROM ghcr.io/meta-pytorch/openenv-base:latest
2
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
6
 
7
- # Copy everything
8
  COPY . /app
9
 
10
- # DEBUG: This will print the file list in your Hugging Face logs
11
- # so we can see where the 'server' folder actually is.
12
- RUN ls -R /app
 
 
 
13
 
 
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
  ENV PYTHONPATH="/app"
18
  EXPOSE 7860
19
 
20
- # We use the module syntax
21
  CMD ["python3", "-m", "uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]
 
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
+ # --- THE NUCLEAR FIX ---
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
+ # Run the app from the folder we just forced into existence
26
  CMD ["python3", "-m", "uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]