Skip to content

YerayAlonso/next-runtime-env-with-docker-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

The problem

Next.js does support environment variables, but only at build time. This means you must rebuild your app for each target environment, which violates the Build once, deploy many principle.

These examples contain everything needed to get a Next.js production environment up and running with Docker Compose and being able to read environment variables from the environment section in your docker-compose.yml file when the container starts.

Examples

Both examples read the system variables and generate a public __env.js/__ENV.js file which exposes the NEXT_PUBLIC_ variables to the client.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published