diff --git a/Dockerfile b/Dockerfile index c897e183..5a2c289d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,19 @@ -FROM node:lts-alpine +FROM node:lts-alpine AS builder +ARG BASE_PATH="/alpha/powerhouse/connect" +ENV BASE_PATH=${BASE_PATH} -ARG X_TAG WORKDIR /opt/app -ENV NODE_ENV=production COPY . . RUN npm install --frozen-lockfile + +# Production image, copy all the files and run next +FROM node:lts-alpine AS runner + +ARG X_TAG +WORKDIR /opt/app +ENV NODE_ENV=production +ARG BASE_PATH="/alpha/powerhouse/connect" ENV BASE_PATH=${BASE_PATH} +COPY --from=builder /opt/app . CMD npm run dev:web -- --host 0.0.0.0 --port ${PORT} --basename ${BASE_PATH} \ No newline at end of file