Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(node): Upgrade to node lts #5394

Merged
merged 4 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.13.0
20.18.0
20 changes: 17 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
&& rm -rf /var/lib/apt/lists/*

RUN wget --quiet -O - https://deb.nodesource.com/setup_16.x | bash - \
RUN wget --quiet -O - https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs --no-install-recommends

ARG SOURCE_COMMIT
Expand Down Expand Up @@ -87,7 +87,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -

RUN wget --quiet -O - https://deb.nodesource.com/setup_12.x | bash -
RUN wget --quiet -O - https://deb.nodesource.com/setup_20.x | bash -

COPY --from=sdist /dist/*.whl /tmp/dist/
RUN buildDeps="" \
Expand All @@ -104,7 +104,21 @@ RUN buildDeps="" \
pkg-config postgresql-client-14 nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& npm install mjml --no-cache-dir
# mjml has to be installed differently here because
# after node 14, docker will install npm files at the
# root directoy and fail, so we have to create a new
# directory and use it for the install then copy the
# files to the root directory to maintain backwards
# compatibility for email generation
&& mkdir -p /mjml_install \
# if our workdir is /, then pushd/popd doesn't work
# for the npm install. It still tries to install in /,
# which npm can't do
&& cd /mjml_install \
&& npm install --no-cache-dir mjml \
&& mv node_modules / \
&& cd / \
&& rm -rf /mjml_install

EXPOSE 8000
VOLUME /var/lib/dispatch/files
Expand Down
Loading