2024-09-11 18:42:08 +02:00
|
|
|
FROM node:20-alpine
|
2021-11-09 18:10:26 +01:00
|
|
|
|
2021-07-29 21:32:18 +02: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"
|
|
|
|
|
2023-05-19 18:30:48 +02:00
|
|
|
WORKDIR /app
|
2020-06-15 18:06:54 +02:00
|
|
|
|
2021-02-25 14:27:46 +01:00
|
|
|
ENV PORT=4001
|
2020-07-08 22:53:15 +02:00
|
|
|
ENV COUCH_DB_URL=https://couchdb.budi.live:5984
|
2020-12-11 17:38:40 +01:00
|
|
|
ENV BUDIBASE_ENVIRONMENT=PRODUCTION
|
2022-06-01 15:10:00 +02:00
|
|
|
ENV SERVICE=app-service
|
2022-08-08 15:03:04 +02:00
|
|
|
ENV POSTHOG_TOKEN=phc_bIjZL7oh2GEUd2vqvTBH8WvrX0fWTFQMs6H5KQxiUxU
|
2022-09-23 14:40:00 +02:00
|
|
|
ENV ACCOUNT_PORTAL_URL=https://account.budibase.app
|
2023-06-07 17:39:33 +02:00
|
|
|
ENV TOP_LEVEL_PATH=/
|
2023-04-24 19:24:09 +02:00
|
|
|
|
2024-09-11 18:42:08 +02:00
|
|
|
# handle node-gyp and install postgres client for pg_dump utils
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
g++ \
|
|
|
|
make \
|
|
|
|
python3 \
|
|
|
|
jq \
|
|
|
|
bash \
|
|
|
|
postgresql-client \
|
|
|
|
git
|
2020-06-15 18:06:54 +02:00
|
|
|
|
2024-09-11 18:42:08 +02:00
|
|
|
RUN yarn global add pm2
|
2023-06-22 12:13:20 +02:00
|
|
|
|
2023-11-24 13:02:14 +01:00
|
|
|
WORKDIR /
|
2023-06-22 12:13:20 +02:00
|
|
|
|
2023-11-24 13:02:14 +01:00
|
|
|
COPY scripts/removeWorkspaceDependencies.sh scripts/removeWorkspaceDependencies.sh
|
|
|
|
RUN chmod +x ./scripts/removeWorkspaceDependencies.sh
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
COPY packages/server/package.json .
|
|
|
|
COPY packages/server/dist/yarn.lock .
|
|
|
|
|
|
|
|
COPY scripts/removeWorkspaceDependencies.sh scripts/removeWorkspaceDependencies.sh
|
|
|
|
RUN chmod +x ./scripts/removeWorkspaceDependencies.sh
|
2024-09-11 18:42:08 +02:00
|
|
|
RUN ./scripts/removeWorkspaceDependencies.sh package.json
|
2023-11-24 13:02:14 +01:00
|
|
|
|
2024-09-11 18:42:08 +02:00
|
|
|
# Install yarn packages with caching
|
2024-03-15 14:07:26 +01:00
|
|
|
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --production=true --network-timeout 1000000 \
|
2024-09-11 18:42:08 +02:00
|
|
|
&& yarn cache clean \
|
|
|
|
&& apk del g++ make python3 jq \
|
2023-05-19 16:26:34 +02:00
|
|
|
&& rm -rf /tmp/* /root/.node-gyp /usr/local/lib/node_modules/npm/node_modules/node-gyp
|
|
|
|
|
2023-11-24 13:02:14 +01:00
|
|
|
COPY packages/server/dist/ dist/
|
|
|
|
COPY packages/server/docker_run.sh .
|
|
|
|
COPY packages/server/builder/ builder/
|
|
|
|
COPY packages/server/client/ client/
|
2024-02-15 13:47:27 +01:00
|
|
|
COPY packages/server/pm2.config.js .
|
2023-11-24 13:02:14 +01:00
|
|
|
|
|
|
|
ARG BUDIBASE_VERSION
|
2023-12-15 10:53:48 +01:00
|
|
|
ARG GIT_COMMIT_SHA
|
2023-11-24 13:02:14 +01:00
|
|
|
# Ensuring the version argument is sent
|
|
|
|
RUN test -n "$BUDIBASE_VERSION"
|
|
|
|
ENV BUDIBASE_VERSION=$BUDIBASE_VERSION
|
2023-12-15 10:53:48 +01: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-05-19 16:26:34 +02:00
|
|
|
|
2020-06-15 18:06:54 +02:00
|
|
|
EXPOSE 4001
|
|
|
|
|
2020-12-11 17:38:40 +01:00
|
|
|
# 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
|
2024-09-11 18:42:08 +02:00
|
|
|
# This is required for isolated-vm to work on Node 20+
|
2024-02-02 12:02:09 +01:00
|
|
|
ENV NODE_OPTIONS="--no-node-snapshot"
|
2022-05-23 17:24:29 +02:00
|
|
|
ENV CLUSTER_MODE=${CLUSTER_MODE}
|
2023-05-19 16:44:09 +02:00
|
|
|
ENV TOP_LEVEL_PATH=/app
|
|
|
|
|
2022-05-23 17:24:29 +02:00
|
|
|
CMD ["./docker_run.sh"]
|