# for customers wishing to build their own docker image over a different base image
# customer to ensure node and npm already installed into base image

# build custome image:
# docker build --build-arg C11N_IMAGE_VERSION=8.7.0-ga-43 -t platform-services/constellationui/service:8.7.0-ga-43 -f ./c11n-docker-image-builder .
# run new image exactly as original:
# docker run -p 3000:3000  --name constellation-service platform-services/constellationui/service 3000 https://1.2.3.4:80

# Stage 1
# Using PEGA shipped Constellation Service(C11n) docker image as base image.  insert correct version here
ARG C11N_IMAGE_VERSION=8.7.0-ga-43
FROM pega-docker.downloads.pega.com/constellationui/service:$C11N_IMAGE_VERSION as c11nSource

# Stage 2
# Base image customization to be done here
FROM node:16-alpine
COPY --from=c11nSource ./usr/src/app /usr/src/app
WORKDIR /usr/src/app
# default port service is listening on
EXPOSE 3000

# composer adds arguements port, static root
ENTRYPOINT ["npm", "start", "root=dist"]
