Architect8999 commited on
Commit
846ce24
·
verified ·
1 Parent(s): 8a58104

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -10
Dockerfile CHANGED
@@ -2,22 +2,23 @@
2
  FROM python:3.12-slim AS builder
3
 
4
  ENV DEBIAN_FRONTEND=noninteractive \
5
- PYTHONUNBUFFERED=1
 
 
6
 
7
  RUN apt-get update && \
8
  apt-get install -y --no-install-recommends git curl ca-certificates build-essential && \
9
  rm -rf /var/lib/apt/lists/*
10
 
11
- # Install uv for fast, conflict-free resolution
12
- RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
13
- mv /root/.local/bin/uv /usr/local/bin/uv
14
 
15
  WORKDIR /build
16
  COPY requirements.txt .
17
 
18
- # FIX: Use uv to resolve the entire requirements tree at once.
19
- # This prevents the "ResolutionImpossible" error by finding the
20
- # valid intersection between Gradio 5 and Aider-chat.
21
  RUN uv pip install --no-cache --system -r requirements.txt mcp-server-fetch && \
22
  pip wheel --no-cache-dir --wheel-dir /wheels -r requirements.txt mcp-server-fetch
23
 
@@ -27,12 +28,16 @@ FROM python:3.12-slim AS runtime
27
 
28
  LABEL org.opencontainers.image.title="Rhodawk AI DevSecOps Engine"
29
 
 
30
  ENV DEBIAN_FRONTEND=noninteractive \
31
  PYTHONUNBUFFERED=1 \
32
  GRADIO_SERVER_NAME=0.0.0.0 \
33
  GRADIO_SERVER_PORT=7860 \
34
  HOME=/home/rhodawk \
35
- PATH="/home/rhodawk/.local/bin:/usr/local/bin:$PATH"
 
 
 
36
 
37
  RUN apt-get update && \
38
  apt-get install -y --no-install-recommends git curl ca-certificates nodejs npm && \
@@ -51,8 +56,8 @@ WORKDIR /app
51
  # Copy pre-built wheels from builder
52
  COPY --from=builder /wheels /wheels
53
 
54
- # ADDED FIX: Copy the uv executable from the builder stage
55
- COPY --from=builder /usr/local/bin/uv /usr/local/bin/uv
56
 
57
  RUN pip install --no-cache-dir /wheels/* && rm -rf /wheels
58
 
 
2
  FROM python:3.12-slim AS builder
3
 
4
  ENV DEBIAN_FRONTEND=noninteractive \
5
+ PYTHONUNBUFFERED=1 \
6
+ UV_COMPILE_BYTECODE=1 \
7
+ UV_LINK_MODE=copy
8
 
9
  RUN apt-get update && \
10
  apt-get install -y --no-install-recommends git curl ca-certificates build-essential && \
11
  rm -rf /var/lib/apt/lists/*
12
 
13
+ # Fix: Use the official Astral image for a complete, clean uv installation
14
+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
 
15
 
16
  WORKDIR /build
17
  COPY requirements.txt .
18
 
19
+ # [span_1](start_span)FIX: Use uv to resolve the entire requirements tree at once.[span_1](end_span)
20
+ # [span_2](start_span)This prevents the "ResolutionImpossible" error by finding the[span_2](end_span)
21
+ # [span_3](start_span)valid intersection between Gradio 5 and Aider-chat.[span_3](end_span)
22
  RUN uv pip install --no-cache --system -r requirements.txt mcp-server-fetch && \
23
  pip wheel --no-cache-dir --wheel-dir /wheels -r requirements.txt mcp-server-fetch
24
 
 
28
 
29
  LABEL org.opencontainers.image.title="Rhodawk AI DevSecOps Engine"
30
 
31
+ # Added critical uv environment variables to force system Python
32
  ENV DEBIAN_FRONTEND=noninteractive \
33
  PYTHONUNBUFFERED=1 \
34
  GRADIO_SERVER_NAME=0.0.0.0 \
35
  GRADIO_SERVER_PORT=7860 \
36
  HOME=/home/rhodawk \
37
+ PATH="/home/rhodawk/.local/bin:/usr/local/bin:$PATH" \
38
+ UV_LINK_MODE=copy \
39
+ UV_PYTHON_PREFERENCE=system \
40
+ UV_PYTHON=/usr/local/bin/python
41
 
42
  RUN apt-get update && \
43
  apt-get install -y --no-install-recommends git curl ca-certificates nodejs npm && \
 
56
  # Copy pre-built wheels from builder
57
  COPY --from=builder /wheels /wheels
58
 
59
+ # ADDED FIX: Copy the uv executable from the official image
60
+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
61
 
62
  RUN pip install --no-cache-dir /wheels/* && rm -rf /wheels
63