Add env vars to kubernetes config for production (#53620)
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
8
config/moda/configuration/production/env.yaml
Normal file
8
config/moda/configuration/production/env.yaml
Normal 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'
|
||||
Reference in New Issue
Block a user