forked from DSpace/dspace-angular
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile.prod
36 lines (28 loc) · 1.1 KB
/
Dockerfile.prod
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# This image will be published as dspace/dspace-angular:$DSPACE_VERSION
# See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details
# When upgrading, this file should be compared to "Dockerfile.dist"
FROM node:18-alpine AS build
# Ensure Python and other build tools are available
# These are needed to install some node modules, especially on linux/arm64
RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/*
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --network-timeout 300000
ADD . /app/
RUN yarn build:prod
FROM node:18-alpine
RUN npm install --global pm2
COPY --chown=node:node --from=build /app/dist /app/dist
COPY --chown=node:node config /app/config
COPY --chown=node:node docker/dspace-ui.json /app/dspace-ui.json
WORKDIR /app
USER node
# UMD Customization - Fix "LegacyKeyValueFormat" warning
ENV NODE_ENV=production
# End UMD Customization
EXPOSE 4000
# UMD Customization
# Running Node directly, instead of using the "pm2" process manager,
# because Kubernetes is acting as our process manager
CMD [ "node", "./dist/server/main.js" ]
# End UMD Customization