Skip to content

Commit 8de7574

Browse files
authored
Add env vars to kubernetes config for production (#53620)
1 parent cdc91ff commit 8de7574

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

Dockerfile

+3-9
Original file line numberDiff line numberDiff line change
@@ -140,20 +140,14 @@ COPY --chown=node:node --from=builder $APP_HOME/next.config.js ./
140140
COPY --chown=node:node --from=builder $APP_HOME/tsconfig.json ./
141141

142142
# - - -
143-
# Environment variables
143+
# Environment variables are set in the Moda
144+
# configuration: config/moda/configuration/*/env.yaml
144145
# - - -
146+
145147
# This makes it possible to set `--build-arg BUILD_SHA=abc123`
146148
# and it then becomes available as an environment variable in the docker run.
147149
ARG BUILD_SHA
148150
ENV BUILD_SHA=$BUILD_SHA
149-
# We should always be running in production mode
150-
ENV NODE_ENV=production
151-
# Preferred port for server.js
152-
ENV PORT=4000
153-
# Include all languages
154-
ENV ENABLED_LANGUAGES="en,zh,es,pt,ru,ja,fr,de,ko"
155-
156-
EXPOSE $PORT
157151

158152
# Entrypoint to start the server
159153
# Note: Currently we have to use tsx because we have a mix of `.ts` and `.js` files with multiple import patterns

config/kubernetes/production/deployments/webapp.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ spec:
3737
name: vault-secrets
3838
- configMapRef:
3939
name: kube-cluster-metadata
40+
# application-config is crated at deploy time from
41+
# configuration set in config/moda/configuration/*/env.yaml
42+
- configMapRef:
43+
name: application-config
4044
# Zero-downtime deploys
4145
# https://thehub.github.com/engineering/products-and-services/internal/moda/feature-documentation/pod-lifecycle/#required-prestop-hook
4246
# https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
data:
2+
NODE_ENV: production
3+
NODE_OPTIONS: '--max-old-space-size=4096'
4+
PORT: '4000'
5+
ENABLED_LANGUAGES: 'en,zh,es,pt,ru,ja,fr,de,ko'
6+
HEROKU_APP_NAME: help-docs
7+
HEROKU_PRODUCTION_APP: 'true'
8+
RATE_LIMIT_MAX: '21'

0 commit comments

Comments
 (0)