portlae / Dockerfile
puzan789's picture
aAded
2214088
raw
history blame contribute delete
729 Bytes
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"]