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- 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 |
-
|
| 21 |
-
|
|
|
|
|
|
|
| 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 ["
|
|
|
|
| 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"]
|