Some checks failed
Build and Push Docker Image / build (push) Failing after 39s
Bake commit SHAs into the Docker image via CI and log them on server startup so it's easy to verify which version of schwab-scraper is running.
39 lines
1.1 KiB
Docker
39 lines
1.1 KiB
Docker
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder
|
|
|
|
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy vendored schwab-scraper (checked out cleanly by CI) and pyproject.toml
|
|
COPY vendor/schwab-scraper /tmp/schwab-scraper
|
|
COPY pyproject.toml uv.lock ./
|
|
|
|
# Install schwab-scraper from the clean build-time checkout, then remaining deps.
|
|
# We strip the git dependency line so uv doesn't try to fetch over the network.
|
|
RUN uv venv && \
|
|
uv pip install /tmp/schwab-scraper && \
|
|
sed -i '/schwab-scraper/d' pyproject.toml && \
|
|
uv pip install -r pyproject.toml && \
|
|
uv pip install --upgrade playwright && \
|
|
rm -rf /tmp/schwab-scraper
|
|
|
|
COPY vendor/schwab-scraper-commit.txt /app/schwab-scraper-commit.txt
|
|
COPY vendor/mcp-server-commit.txt /app/mcp-server-commit.txt
|
|
|
|
COPY . .
|
|
|
|
FROM python:3.12-slim-bookworm
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends curl && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
COPY --from=builder /app /app
|
|
|
|
ENV PATH="/app/.venv/bin:$PATH"
|
|
ENV PORT=8000
|
|
|
|
EXPOSE 8000
|
|
CMD ["python", "server.py"]
|