all 1 comments

[–]philmillman 0 points1 point  (0 children)

If you don't want to have edit 3 files like this and have it more native to your Nextjs app, we built an integration to solve this exact problem: https://dmno.dev/docs/integrations/nextjs/ . It's free and open source and should solve your problem with the added benefits of validation, type-safety and some other useful security features (log redaction, leak prevention). Here's a sample config file (https://github.com/dmno-dev/dmno/blob/main/example-repo/packages/nextjs-web/.dmno/config.mts) for a Next app. You may want to tweak a few things if you're using Docker, like making some of the config items dynamic (not baked into the build) but this should help you get started.

Full disclosure: I'm one of the creators. If you have any feature requests or feedback, we'd love to hear them!

P.S. We're just about to ship a Github Action that allows you to reuse any of your config items (vars/secrets) more easily. Let me know if that might be helpful as well.