summaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-03-04 16:51:39 +0100
committerArmand Philippot <git@armandphilippot.com>2022-03-04 16:51:39 +0100
commit79e3429ea8fb590f82b11f2b19a26427f2d1da4f (patch)
tree07db0315d91ffbe64d9a3ba0cb448d2a0082c164 /Dockerfile
parent4ed70beabc73dd9aa1d2e06ab5902ded0801c404 (diff)
build(docker): allow specific config for staging service
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile10
1 files changed, 10 insertions, 0 deletions
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