mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-06 17:44:11 +00:00
32 lines
903 B
Docker
32 lines
903 B
Docker
# This image will be published as dspace/dspace-angular:$DSPACE_VERSION-dist
|
|
# See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details
|
|
|
|
# Test build:
|
|
# docker build -f Dockerfile.dist -t dspace/dspace-angular:latest-dist .
|
|
|
|
FROM docker.io/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 package-lock.json ./
|
|
RUN npm install
|
|
|
|
ADD . /app/
|
|
RUN npm run 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
|
|
ENV NODE_ENV=production
|
|
EXPOSE 4000
|
|
CMD pm2-runtime start dspace-ui.json --json
|