@@ -5,30 +5,27 @@ FROM python:3.12-slim
55
66WORKDIR /app
77
8- # Install uv first (rarely changes)
9- RUN pip install uv
8+ # Install only runtime dependencies at build time.
9+ ENV PIP_NO_CACHE_DIR=1 \
10+ PYTHONDONTWRITEBYTECODE=1 \
11+ PYTHONUNBUFFERED=1
1012
11- # Copy dependency file first ( for better caching)
13+ # Copy dependency metadata first for better layer caching.
1214COPY pyproject.toml ./
1315
14- # Install dependencies only (cached unless pyproject.toml changes)
15- RUN uv pip install --system -r pyproject.toml
16+ # Install dependencies into system site-packages during build.
17+ RUN pip install --no-cache-dir uv && \
18+ uv pip install --system -r pyproject.toml && \
19+ pip uninstall -y uv && \
20+ rm -rf /root/.cache/uv /root/.cache/pip
1621
17- # Copy application code (invalidates cache only on code changes)
22+ # Copy the rest of the application source.
1823COPY . /app/
1924
20- # Set UV cache directory to a writable location
21- ENV UV_CACHE_DIR=/app/.uv-cache
22- ENV XDG_CACHE_HOME=/app/.cache
23-
24- # Create cache directories with proper permissions
25- RUN mkdir -p /app/.uv-cache /app/.cache && \
26- chmod -R 777 /app/.uv-cache /app/.cache
27-
2825# Ensure all app files have proper ownership and permissions for non-root users
2926RUN chown -R 1001:0 /app && \
3027 chmod -R g+rwX /app
3128
3229EXPOSE 8501
3330
34- ENTRYPOINT ["uv " , "run " , "streamlit" , "run" , "/app/llama_stack_ui/distribution/ui/app.py" , "--server.port=8501" , "--server.address=0.0.0.0" ]
31+ ENTRYPOINT ["python " , "-m " , "streamlit" , "run" , "/app/llama_stack_ui/distribution/ui/app.py" , "--server.port=8501" , "--server.address=0.0.0.0" ]
0 commit comments