omarsol commited on
Commit
3635a7d
·
1 Parent(s): fed171e

Bugfix Dockerfile to install uv in /usr/local/bin for all users, improving accessibility. Update CMD to use 'uv' directly for running the FastAPI application.

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -4
Dockerfile CHANGED
@@ -17,8 +17,10 @@ RUN npm run build
17
  # Stage 2: Python runtime + FastAPI + bundled static frontend
18
  FROM python:3.13
19
 
20
- RUN curl -LsSf https://astral.sh/uv/install.sh | sh
21
- ENV PATH="/root/.local/bin:${PATH}"
 
 
22
 
23
  RUN useradd -m -u 1000 user
24
  WORKDIR /app
@@ -30,10 +32,9 @@ COPY . .
30
  COPY --from=frontend /frontend/out ./frontend/out
31
 
32
  ENV HOME=/home/user \
33
- PATH="/root/.local/bin:/home/user/.local/bin:${PATH}" \
34
  PORT=7860
35
  RUN chown -R user:user /app
36
  USER user
37
 
38
  EXPOSE 7860
39
- CMD ["sh", "-c", "uv run uvicorn scripts.api:app --host 0.0.0.0 --port ${PORT:-7860}"]
 
17
  # Stage 2: Python runtime + FastAPI + bundled static frontend
18
  FROM python:3.13
19
 
20
+ # Install uv into /usr/local/bin (on PATH for every user, including HF's uid 1000).
21
+ RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
22
+ && mv /root/.local/bin/uv /root/.local/bin/uvx /usr/local/bin/ \
23
+ && rm -rf /root/.local /root/.cache
24
 
25
  RUN useradd -m -u 1000 user
26
  WORKDIR /app
 
32
  COPY --from=frontend /frontend/out ./frontend/out
33
 
34
  ENV HOME=/home/user \
 
35
  PORT=7860
36
  RUN chown -R user:user /app
37
  USER user
38
 
39
  EXPOSE 7860
40
+ CMD ["uv", "run", "-m", "scripts.api"]