Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions docker/cpu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,21 @@ RUN apt-get update -y && \
curl -LsSf https://astral.sh/uv/install.sh | sh && \
mv /root/.local/bin/uv /usr/local/bin/ && \
mv /root/.local/bin/uvx /usr/local/bin/ && \
curl https://sh.rustup.rs -sSf | sh -s -- -y && \
useradd -m -u 1000 appuser && \
mkdir -p /app/api/src/models/v1_0 && \
chown -R appuser:appuser /app

USER appuser
WORKDIR /app

# Install Rust for the non-root user so builds (e.g., sudachipy) succeed
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y

# Ensure Cargo and the Python venv are on PATH; extend HTTP timeouts for uv
ENV PATH="/home/appuser/.cargo/bin:/app/.venv/bin:$PATH" \
UV_HTTP_TIMEOUT=120 \
UV_HTTP_RETRIES=3

# Copy dependency files
COPY --chown=appuser:appuser pyproject.toml ./pyproject.toml

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

# Set environment variables
ENV PATH="/home/appuser/.cargo/bin:/app/.venv/bin:$PATH" \
PYTHONUNBUFFERED=1 \
ENV PYTHONUNBUFFERED=1 \
PYTHONPATH=/app:/app/api \
UV_LINK_MODE=copy \
USE_GPU=false \
Expand Down