From cd736cdfdfed327789ace2d0cc739eb0b53a17ad Mon Sep 17 00:00:00 2001 From: Krystle Salazar Date: Mon, 1 Aug 2022 13:13:48 -0400 Subject: [PATCH 1/2] Add extra packages to build docker image on macOS --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 10d6402c9b..ad15865769 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM node:16-alpine -RUN npm install -g pnpm pm2@5.2.0 +RUN apk add --no-cache --virtual .gyp python3 make g++ \ + && npm install -g pnpm pm2@5.2.0 USER node From 4c7aa5bc959fda238bbf74671840e74a79d6e034 Mon Sep 17 00:00:00 2001 From: Krystle Salazar Date: Mon, 1 Aug 2022 19:26:35 -0400 Subject: [PATCH 2/2] Multi-stage building --- Dockerfile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ad15865769..d8a5e2cf56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16-alpine +FROM node:16-alpine as builder RUN apk add --no-cache --virtual .gyp python3 make g++ \ && npm install -g pnpm pm2@5.2.0 @@ -32,6 +32,20 @@ RUN pnpm build:only COPY ecosystem.config.js /home/node/app/ecosystem.config.js +################### +# Nuxt app +################### + +FROM node:alpine as app + +WORKDIR /home/node/app + +RUN npm install -g pm2@5.2.0 + +USER node + +COPY --from=builder --chown=node:node /home/node/app . + # set app serving to permissive / assigned ENV NUXT_HOST=0.0.0.0