Bridge worker updates

This commit is contained in:
Darren Clarke 2024-04-21 16:59:50 +02:00
parent a445762a37
commit f93c4ad317
33 changed files with 17584 additions and 161 deletions

View file

@ -0,0 +1,32 @@
FROM node:18-alpine as base
FROM base AS builder
ARG APP_DIR=/opt/bridge
RUN mkdir -p ${APP_DIR}/
RUN npm i -g turbo
WORKDIR ${APP_DIR}
COPY . .
RUN turbo prune --scope=bridge-worker --docker
FROM base AS installer
ARG APP_DIR=/opt/bridge
WORKDIR ${APP_DIR}
COPY .gitignore .gitignore
COPY --from=builder ${APP_DIR}/out/json/ .
COPY --from=builder ${APP_DIR}/out/package-lock.json ./package-lock.json
COPY --from=builder ${APP_DIR}/out/full/ .
RUN npm ci
RUN npm i -g turbo
RUN turbo run build --filter=bridge-worker
FROM graphile/worker:0.16.5 as runner
ARG APP_DIR=/opt/bridge
RUN mkdir -p ${APP_DIR}/
ARG BUILD_DIR=${APP_DIR}/apps/bridge-worker/build/main
RUN mkdir -p ${APP_DIR}/
WORKDIR /worker
COPY --from=installer ${BUILD_DIR}/lib ${APP_DIR}/lib
COPY --from=installer ${BUILD_DIR}/tasks ${APP_DIR}/tasks
COPY --from=installer ${APP_DIR}/apps/bridge-worker/graphile.config.prod.js ./graphile.config.js
COPY --from=installer ${APP_DIR}/node_modules ${APP_DIR}/node_modules
COPY --from=installer ${APP_DIR}/package.json ${APP_DIR}/package.json