Hi there, would like to ask if there is a way to r...
# general
c
Hi there, would like to ask if there is a way to reference a .env file in container apps? trying to build the container app without exposing most of the values in the code.
Copy code
minReplicas: 1, 
maxReplicas: 1, 
containers: [
     {
      name: "xxxx", 
      image: "xxxx.xxx.zzzz",
      cpu: x.x, 
      memory: "xGi",
      envs: [
         {
          (.env.file???)
         }
  ]
     }
]
Thank you in advance :)
l
Hi Carl. I think you have a few options: • Read the variables from Pulumi config (e.g.
Pulumi.<stack>.yaml
using
pulumi.Config
etc. modules. This would mean that you'd have
.env
files for local development and
Pulumi.<stack>.yaml
files for deployed stacks. The potential upside is that you can use secrets etc. in your Pulumi configuration (assuming you use Pulumi Cloud or another appropriate secrets backend). • Read the
.env
files yourself (e.g. using
dotenv
, or just
fs.readFileSync
-- whatever you prefer) and parse/pass them in manually.
c
Appreciate the guidance Will! I shall give this a try 🙏.