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 \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
curl \
|
curl \
|
||||||
&& curl -LsSf https://astral.sh/uv/install.sh | sh \
|
&& curl -LsSf https://astral.sh/uv/install.sh | sh \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& mv /root/.local/bin/uv /usr/local/bin/uv \
|
||||||
|
&& mv /root/.local/bin/uvx /usr/local/bin/uvx \
|
||||||
# Add uv to PATH
|
&& rm -rf /var/lib/apt/lists/* /root/.local
|
||||||
ENV PATH="/root/.cargo/bin:$PATH"
|
|
||||||
|
|
||||||
# Create app user
|
# Create app user
|
||||||
RUN groupadd --gid 1000 app && \
|
RUN groupadd --gid 1000 app && \
|
||||||
@@ -26,16 +25,13 @@ RUN groupadd --gid 1000 app && \
|
|||||||
# Set work directory
|
# Set work directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy dependency files
|
# Copy source code
|
||||||
COPY pyproject.toml uv.lock ./
|
COPY . .
|
||||||
|
|
||||||
# Install dependencies with uv
|
# Install dependencies with uv
|
||||||
RUN uv venv && \
|
RUN uv venv && \
|
||||||
uv pip install -e ".[web]"
|
uv pip install -e ".[web]"
|
||||||
|
|
||||||
# Copy source code
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# Make scripts executable
|
# Make scripts executable
|
||||||
RUN chmod +x unitforge-cli start-server.sh demo.sh 2>/dev/null || true
|
RUN chmod +x unitforge-cli start-server.sh demo.sh 2>/dev/null || true
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user