Skip to content

Commit b788dae

Browse files
authored
Merge pull request #383 from nRanzo/fix/rust-appuser-and-path
2 parents 6ffdbc5 + 482fd8c commit b788dae

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

docker/cpu/Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,21 @@ RUN apt-get update -y && \
1010
curl -LsSf https://astral.sh/uv/install.sh | sh && \
1111
mv /root/.local/bin/uv /usr/local/bin/ && \
1212
mv /root/.local/bin/uvx /usr/local/bin/ && \
13-
curl https://sh.rustup.rs -sSf | sh -s -- -y && \
1413
useradd -m -u 1000 appuser && \
1514
mkdir -p /app/api/src/models/v1_0 && \
1615
chown -R appuser:appuser /app
1716

1817
USER appuser
1918
WORKDIR /app
2019

20+
# Install Rust for the non-root user so builds (e.g., sudachipy) succeed
21+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
22+
23+
# Ensure Cargo and the Python venv are on PATH; extend HTTP timeouts for uv
24+
ENV PATH="/home/appuser/.cargo/bin:/app/.venv/bin:$PATH" \
25+
UV_HTTP_TIMEOUT=120 \
26+
UV_HTTP_RETRIES=3
27+
2128
# Copy dependency files
2229
COPY --chown=appuser:appuser pyproject.toml ./pyproject.toml
2330

@@ -32,8 +39,7 @@ COPY --chown=appuser:appuser docker/scripts/ ./
3239
RUN chmod +x ./entrypoint.sh
3340

3441
# Set environment variables
35-
ENV PATH="/home/appuser/.cargo/bin:/app/.venv/bin:$PATH" \
36-
PYTHONUNBUFFERED=1 \
42+
ENV PYTHONUNBUFFERED=1 \
3743
PYTHONPATH=/app:/app/api \
3844
UV_LINK_MODE=copy \
3945
USE_GPU=false \

0 commit comments

Comments
 (0)