1
0
Fork 0
mirror of synced 2024-07-06 15:00:49 +12:00
budibase/packages/worker/Dockerfile

63 lines
2.2 KiB
Docker
Raw Normal View History

FROM node:18-alpine
2021-07-30 07:32:18 +12:00
LABEL com.centurylinklabs.watchtower.lifecycle.pre-check="scripts/watchtower-hooks/pre-check.sh"
LABEL com.centurylinklabs.watchtower.lifecycle.pre-update="scripts/watchtower-hooks/pre-update.sh"
LABEL com.centurylinklabs.watchtower.lifecycle.post-update="scripts/watchtower-hooks/post-update.sh"
LABEL com.centurylinklabs.watchtower.lifecycle.post-check="scripts/watchtower-hooks/post-check.sh"
# handle node-gyp
2023-11-25 01:02:14 +13:00
RUN apk add --no-cache --virtual .gyp python3 make g++ jq
RUN yarn global add pm2
2023-11-25 01:02:14 +13:00
WORKDIR /
COPY scripts/removeWorkspaceDependencies.sh scripts/removeWorkspaceDependencies.sh
RUN chmod +x ./scripts/removeWorkspaceDependencies.sh
WORKDIR /string-templates
COPY packages/string-templates/package.json package.json
RUN ../scripts/removeWorkspaceDependencies.sh package.json
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production=true --network-timeout 1000000
COPY packages/string-templates .
2023-05-20 00:45:05 +12:00
2023-11-25 01:02:14 +13:00
WORKDIR /app
COPY packages/worker/package.json .
COPY packages/worker/dist/yarn.lock .
RUN cd ../string-templates && yarn link && cd - && yarn link @budibase/string-templates
RUN ../scripts/removeWorkspaceDependencies.sh package.json
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production=true --network-timeout 1000000
2023-05-23 21:54:10 +12:00
# Remove unneeded data from file system to reduce image size
2023-05-20 00:45:05 +12:00
RUN apk del .gyp \
&& yarn cache clean
2023-11-25 01:02:14 +13:00
COPY packages/worker/dist/ dist/
COPY packages/worker/docker_run.sh .
2023-05-20 00:45:05 +12:00
EXPOSE 4001
# have to add node environment production after install
# due to this causing yarn to stop installing dev dependencies
# which are actually needed to get this environment up and running
ENV NODE_ENV=production
ENV CLUSTER_MODE=${CLUSTER_MODE}
ENV SERVICE=worker-service
2022-08-09 01:03:04 +12:00
ENV POSTHOG_TOKEN=phc_bIjZL7oh2GEUd2vqvTBH8WvrX0fWTFQMs6H5KQxiUxU
ENV TENANT_FEATURE_FLAGS=*:LICENSING,*:USER_GROUPS,*:ONBOARDING_TOUR
ENV ACCOUNT_PORTAL_URL=https://account.budibase.app
2023-11-25 01:02:14 +13:00
ARG BUDIBASE_VERSION
2023-12-15 22:53:48 +13:00
ARG GIT_COMMIT_SHA
2023-11-25 01:02:14 +13:00
# Ensuring the version argument is sent
RUN test -n "$BUDIBASE_VERSION"
ENV BUDIBASE_VERSION=$BUDIBASE_VERSION
2023-12-15 22:53:48 +13:00
ENV DD_GIT_REPOSITORY_URL=https://github.com/budibase/budibase
ENV DD_GIT_COMMIT_SHA=$GIT_COMMIT_SHA
ENV DD_VERSION=$BUDIBASE_VERSION
2023-11-25 01:02:14 +13:00
CMD ["./docker_run.sh"]