0

i have this code on my webpack.config.js file

const environment = process.env.ENVIRONMENT;
const uridb = `mongodb+srv://admin:admin@development-db.${process.env.URI}.mongodb.net/development?retryWrites=true&w=majority`

and inside my task definition you can see that the env do exist enter image description here

but when i see the logs on my container i get undefined

MONGO_CONNECTION_STRING mongodb+srv://admin:admin@development-db.undefined.mongodb.net/development?retryWrites=true&w=majority

how do i make my envs reachable?

randomuser
  • 19
  • 2

1 Answers1

0

Your Webpack config file is something that is used at build time. Webpack is a build tool. You need to move that ${process.env.URI} environment variable lookup into your actual application code so that it can be resolved at run-time.

Mark B
  • 183,023
  • 24
  • 297
  • 295