1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Add env vars to kubernetes config for production (#53620)

This commit is contained in:
Rachael Sewell
2024-12-16 15:42:58 -08:00
committed by GitHub
parent cdc91ff623
commit 8de75746da
3 changed files with 15 additions and 9 deletions

View File

@@ -140,20 +140,14 @@ COPY --chown=node:node --from=builder $APP_HOME/next.config.js ./
COPY --chown=node:node --from=builder $APP_HOME/tsconfig.json ./
# - - -
# Environment variables
# Environment variables are set in the Moda
# configuration: config/moda/configuration/*/env.yaml
# - - -
# This makes it possible to set `--build-arg BUILD_SHA=abc123`
# and it then becomes available as an environment variable in the docker run.
ARG BUILD_SHA
ENV BUILD_SHA=$BUILD_SHA
# We should always be running in production mode
ENV NODE_ENV=production
# Preferred port for server.js
ENV PORT=4000
# Include all languages
ENV ENABLED_LANGUAGES="en,zh,es,pt,ru,ja,fr,de,ko"
EXPOSE $PORT
# Entrypoint to start the server
# Note: Currently we have to use tsx because we have a mix of `.ts` and `.js` files with multiple import patterns

View File

@@ -37,6 +37,10 @@ spec:
name: vault-secrets
- configMapRef:
name: kube-cluster-metadata
# application-config is crated at deploy time from
# configuration set in config/moda/configuration/*/env.yaml
- configMapRef:
name: application-config
# Zero-downtime deploys
# https://thehub.github.com/engineering/products-and-services/internal/moda/feature-documentation/pod-lifecycle/#required-prestop-hook
# https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks

View File

@@ -0,0 +1,8 @@
data:
NODE_ENV: production
NODE_OPTIONS: '--max-old-space-size=4096'
PORT: '4000'
ENABLED_LANGUAGES: 'en,zh,es,pt,ru,ja,fr,de,ko'
HEROKU_APP_NAME: help-docs
HEROKU_PRODUCTION_APP: 'true'
RATE_LIMIT_MAX: '21'