BlocknoteJS requires an ESM module where our server is CJS, this forced us to pin the server-util version, which led us to force the resolution of several packages, leading to bugs downstream. From Node 22.12 Node supports requiring ESM modules (available from Node 22.0 with a flag). So I upgrade the module. I picked Node 22 and not Node 23 or Node 24 because 22 is the LTS and we don't plan to change node versions frequently. If you remain on Node 18, things should still mostly work, except if you edit a Rich Text field. I also starting changing the default runtime for Serverless Functions which isn't directly related. This means new serverless functions will be created on Node 22, but we will still need another PR to migrate existing serverless functions before September (end of support by AWS). (In this PR I also remove the upgrade commands from 0.43 since they rely on Blocknote and I didn't want to have to deal with this) --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
42 lines
1.2 KiB
Docker
42 lines
1.2 KiB
Docker
FROM node:22-alpine as twenty-website-build
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
COPY ./package.json .
|
|
COPY ./yarn.lock .
|
|
COPY ./.yarnrc.yml .
|
|
COPY ./.yarn/releases /app/.yarn/releases
|
|
COPY ./tools/eslint-rules /app/tools/eslint-rules
|
|
COPY ./packages/twenty-ui/package.json /app/packages/twenty-ui/
|
|
COPY ./packages/twenty-shared/package.json /app/packages/twenty-shared/
|
|
COPY ./packages/twenty-website/package.json /app/packages/twenty-website/package.json
|
|
|
|
RUN yarn
|
|
|
|
ENV KEYSTATIC_GITHUB_CLIENT_ID="<fake build value>"
|
|
ENV KEYSTATIC_GITHUB_CLIENT_SECRET="<fake build value>"
|
|
ENV KEYSTATIC_SECRET="<fake build value>"
|
|
ENV NEXT_PUBLIC_KEYSTATIC_GITHUB_APP_SLUG="<fake build value>"
|
|
|
|
COPY ./packages/twenty-ui /app/packages/twenty-ui
|
|
COPY ./packages/twenty-website /app/packages/twenty-website
|
|
RUN npx nx build twenty-website
|
|
|
|
FROM node:22-alpine as twenty-website
|
|
|
|
WORKDIR /app/packages/twenty-website
|
|
|
|
COPY --from=twenty-website-build /app /app
|
|
|
|
WORKDIR /app/packages/twenty-website
|
|
|
|
LABEL org.opencontainers.image.source=https://github.com/twentyhq/twenty
|
|
LABEL org.opencontainers.image.description="This image provides a consistent and reproducible environment for the website."
|
|
|
|
RUN chown -R 1000 /app
|
|
|
|
# Use non root user with uid 1000
|
|
USER 1000
|
|
|
|
CMD ["/bin/sh", "-c", "npx nx start"] |