andrewmclagan/react-env

NextJS + Dockerfile

Opened this issue · 1 comments

I'm unsuccessfully trying to get your library to work in Dockerfile.
My problem is as follows, I would like to pass APP_ENV as a build-arg to the Dockerfile and then make react-env generate the file according to the passed argument, having multiple .env (qa, dev, prod). Could you add an example to git with this?

I tried something like that:
CMD yarn react-env --path .env.${APP_ENV} && yarn start
where APP_ENV is a build-arg, but doesn't work.

I've actually put react-env --silent onto the package.json build script, so when I run the same on Docker, it looks for a .env file. You can checkout the source code for better reference here: https://github.com/AmruthPillai/Reactive-Resume/