fix: resolve uv installation in Docker container
- Fix uv installation path from /root/.cargo/bin to /root/.local/bin - Move uv and uvx binaries to /usr/local/bin for all users - Fix build order to copy source before installing package - Container now starts successfully with uv available
This commit is contained in:
14
Dockerfile
14
Dockerfile
@@ -14,10 +14,9 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
&& curl -LsSf https://astral.sh/uv/install.sh | sh \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Add uv to PATH
|
||||
ENV PATH="/root/.cargo/bin:$PATH"
|
||||
&& mv /root/.local/bin/uv /usr/local/bin/uv \
|
||||
&& mv /root/.local/bin/uvx /usr/local/bin/uvx \
|
||||
&& rm -rf /var/lib/apt/lists/* /root/.local
|
||||
|
||||
# Create app user
|
||||
RUN groupadd --gid 1000 app && \
|
||||
@@ -26,16 +25,13 @@ RUN groupadd --gid 1000 app && \
|
||||
# Set work directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy dependency files
|
||||
COPY pyproject.toml uv.lock ./
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Install dependencies with uv
|
||||
RUN uv venv && \
|
||||
uv pip install -e ".[web]"
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Make scripts executable
|
||||
RUN chmod +x unitforge-cli start-server.sh demo.sh 2>/dev/null || true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user