From 79e3429ea8fb590f82b11f2b19a26427f2d1da4f Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 4 Mar 2022 16:51:39 +0100 Subject: build(docker): allow specific config for staging service --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index ce1176a..4e335b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,10 @@ FROM node:16-alpine AS deps # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. RUN apk add --no-cache libc6-compat WORKDIR /app + +ARG APP_ENV=production +ENV APP_ENV ${APP_ENV} + COPY package.json yarn.lock ./ RUN yarn install --frozen-lockfile @@ -13,6 +17,10 @@ RUN yarn install --frozen-lockfile # Rebuild the source code only when needed FROM node:16-alpine AS builder WORKDIR /app + +ARG APP_ENV=production +ENV APP_ENV ${APP_ENV} + COPY --from=deps /app/node_modules ./node_modules COPY . . @@ -27,6 +35,8 @@ RUN yarn build FROM node:16-alpine AS runner WORKDIR /app +ARG APP_ENV=production +ENV APP_ENV ${APP_ENV} ENV NODE_ENV production # Uncomment the following line in case you want to disable telemetry during runtime. # ENV NEXT_TELEMETRY_DISABLED 1 -- cgit v1.2.3