Some checks failed
Build and Push Docker Image / build (push) Failing after 34s
- Dockerfile now installs schwab-scraper from vendor/ dir (no git needed) - Upgrade playwright to latest to match browserless chromium container - CI workflow checks out schwab-scraper into vendor/ before build - Add scripts/build.sh for local builds via docker-test - Add curl to runtime image for compose healthcheck - Increase memory limit to 512M for large account position scraping
33 lines
856 B
Docker
33 lines
856 B
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 pyproject.toml uv.lock ./
|
|
COPY vendor/schwab-scraper /tmp/schwab-scraper
|
|
|
|
# Install schwab-scraper from vendored source, then all other deps.
|
|
# We strip the git dependency from pyproject.toml so uv doesn't try to fetch it.
|
|
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 . .
|
|
|
|
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"]
|