|
1 | 1 | # This image will be published as dspace/dspace-angular |
2 | 2 | # See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details |
3 | 3 |
|
4 | | -FROM docker.io/node:20-alpine |
| 4 | +FROM docker.io/node:22-alpine |
5 | 5 |
|
6 | 6 | # Ensure Python and other build tools are available |
7 | 7 | # These are needed to install some node modules, especially on linux/arm64 |
8 | 8 | RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/* |
9 | 9 |
|
10 | 10 | WORKDIR /app |
11 | | -ADD . /app/ |
12 | | -EXPOSE 4000 |
13 | 11 |
|
14 | | -RUN npm install |
| 12 | +# Copy over package files first, so this layer will only be rebuilt if those files change. |
| 13 | +COPY package.json package-lock.json ./ |
| 14 | +# NOTE: "ci" = clean install from package files |
| 15 | +RUN npm ci |
| 16 | + |
| 17 | +# Add the rest of the source code |
| 18 | +COPY . /app/ |
15 | 19 |
|
16 | 20 | # When running in dev mode, 4GB of memory is required to build & launch the app. |
17 | 21 | # This default setting can be overridden as needed in your shell, via an env file or in docker-compose. |
18 | 22 | # See Docker environment var precedence: https://docs.docker.com/compose/environment-variables/envvars-precedence/ |
19 | 23 | ENV NODE_OPTIONS="--max_old_space_size=4096" |
20 | 24 |
|
21 | 25 | # On startup, run in DEVELOPMENT mode (this defaults to live reloading enabled, etc). |
22 | | -# Listen / accept connections from all IP addresses. |
23 | | -# NOTE: At this time it is only possible to run Docker container in Production mode |
24 | | -# if you have a public URL. See https://github.com/DSpace/dspace-angular/issues/1485 |
25 | 26 | ENV NODE_ENV=development |
26 | | -CMD npm run serve -- --host 0.0.0.0 |
| 27 | + |
| 28 | +EXPOSE 4000 |
| 29 | + |
| 30 | +# On startup, run this command to start application in dev mode |
| 31 | +ENTRYPOINT [ "npm", "run", "serve" ] |
| 32 | +# By default set host to 0.0.0.0 to listen/accept connections from all IP addresses. |
| 33 | +CMD ["--", "--host 0.0.0.0"] |
0 commit comments