|
1 | 1 | ARG NODE_VERSION |
2 | 2 | ARG PHP_VERSION |
3 | 3 |
|
4 | | -FROM node:${NODE_VERSION}-bullseye as nodeJs |
| 4 | +FROM node:${NODE_VERSION}-bookworm as nodeJs |
5 | 5 |
|
6 | 6 | USER root |
7 | 7 |
|
8 | 8 | RUN chown -R root:root /opt |
9 | 9 |
|
10 | | -FROM php:${PHP_VERSION}-cli-bullseye |
| 10 | +FROM public.ecr.aws/forumone/php-cli:${PHP_VERSION} |
11 | 11 |
|
12 | | -## This is needed forhte time being since node module: fiber is being used in gesso |
| 12 | +## This is needed for the time being since node module: fiber is being used in gesso |
13 | 13 | ## https://github.com/forumone/gesso/issues/626 |
14 | | -# |
15 | | -RUN apt update |
16 | | -RUN apt install -y python3 python2 |
17 | | - |
18 | | - |
19 | | -# Instead of building node from source, just pulling a compiled version already |
| 14 | +# Base persistent dependencies |
| 15 | +RUN set -eux \ |
| 16 | + && apt-get update \ |
| 17 | + && apt-get install -y --no-install-recommends \ |
| 18 | + python3 \ |
| 19 | + && rm -rf /var/lib/apt/lists/* |
| 20 | + |
| 21 | +# Instead of building NodeKS from source, just pulling a compiled version already. |
20 | 22 | COPY --from=nodeJs /usr/local/bin/node /usr/local/bin/node |
21 | 23 | COPY --from=nodeJs /usr/local/lib/node_modules /usr/local/lib/node_modules |
22 | 24 | COPY --from=nodeJs /opt /opt |
23 | 25 |
|
24 | | -# Making the correct symlinks needed for node |
25 | | -RUN ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm |
26 | | -RUN ln -s ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx |
27 | | -RUN ln -s /opt/*/bin/yarn /usr/local/bin/yarn |
28 | | -RUN ln -s /opt/*/bin/yarnpkg /usr/local/bin/yarnpkg |
| 26 | +# Making the correct symlinks needed for NodeJS. |
| 27 | +RUN set -eux \ |
| 28 | + && ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \ |
| 29 | + && ln -s ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx \ |
| 30 | + && ln -s /opt/*/bin/yarn /usr/local/bin/yarn \ |
| 31 | + && ln -s /opt/*/bin/yarnpkg /usr/local/bin/yarnpkg |
29 | 32 |
|
| 33 | +# Install required global NPM packages. |
30 | 34 | RUN npm i -g envinfo gulp-cli pm2 |
31 | 35 |
|
32 | | - |
33 | 36 | # Default working directory to /app - this gives folks a predicable location for builds |
34 | 37 | # and artifacts. |
35 | 38 | WORKDIR /app |
|
0 commit comments