speed up docker deploy builds

This commit is contained in:
dirtydishes 2026-05-16 17:54:00 -04:00
parent 2abdd24e2c
commit 23ed3809cc
7 changed files with 349 additions and 22 deletions

View file

@ -1,3 +1,5 @@
# syntax=docker/dockerfile:1.7
FROM oven/bun:1.3.11
WORKDIR /app
@ -9,15 +11,39 @@ ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
COPY --from=workspace package.json ./package.json
COPY --from=workspace bun.lock ./bun.lock
COPY --from=workspace tsconfig.base.json ./tsconfig.base.json
COPY --from=services . ./services
COPY --from=packages . ./packages
COPY --from=apps . ./apps
RUN apt-get update \
&& apt-get install -y --no-install-recommends python3 python3-pip python3-venv \
&& rm -rf /var/lib/apt/lists/* \
&& python3 -m venv "${VIRTUAL_ENV}" \
&& "${VIRTUAL_ENV}/bin/pip" install --no-cache-dir -r services/ingest-options/py/requirements.txt \
&& bun install --frozen-lockfile
&& python3 -m venv "${VIRTUAL_ENV}"
COPY --from=apps desktop/package.json ./apps/desktop/package.json
COPY --from=apps web/package.json ./apps/web/package.json
COPY --from=packages bus/package.json ./packages/bus/package.json
COPY --from=packages config/package.json ./packages/config/package.json
COPY --from=packages observability/package.json ./packages/observability/package.json
COPY --from=packages storage/package.json ./packages/storage/package.json
COPY --from=packages types/package.json ./packages/types/package.json
COPY --from=services api/package.json ./services/api/package.json
COPY --from=services candles/package.json ./services/candles/package.json
COPY --from=services compute/package.json ./services/compute/package.json
COPY --from=services eod-enricher/package.json ./services/eod-enricher/package.json
COPY --from=services ingest-equities/package.json ./services/ingest-equities/package.json
COPY --from=services ingest-options/package.json ./services/ingest-options/package.json
COPY --from=services ingest-options/py/requirements.txt ./services/ingest-options/py/requirements.txt
COPY --from=services refdata/package.json ./services/refdata/package.json
COPY --from=services replay/package.json ./services/replay/package.json
RUN --mount=type=cache,target=/root/.cache/pip \
"${VIRTUAL_ENV}/bin/pip" install -r services/ingest-options/py/requirements.txt
RUN --mount=type=cache,target=/root/.bun/install/cache \
bun install --frozen-lockfile
COPY --from=services . ./services
COPY --from=packages . ./packages
COPY --from=apps . ./apps
ENTRYPOINT ["bun"]