File size: 729 Bytes
2214088
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM python:3.13-slim

ENV PYTHONUNBUFFERED=1

# Install astral UV runtime
COPY --from=ghcr.io/astral-sh/uv:0.6.13 /uv /uvx /bin/
ENV PATH="/app/.venv/bin:$PATH"
ENV UV_COMPILE_BYTECODE=1
ENV UV_LINK_MODE=copy

WORKDIR /app

# Copy dependency files first
COPY ./pyproject.toml ./uv.lock /app/

# Install dependencies
RUN --mount=type=cache,target=/root/.cache/uv \
    uv sync --frozen --no-install-project

ENV PYTHONPATH=/app

# Copy project files (including src/)
COPY ./app.py /app/app.py
COPY ./src /app/src

# Final sync (optional, but safe)
RUN --mount=type=cache,target=/root/.cache/uv \
    uv sync

EXPOSE 8501

# Launch Streamlit app
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]