简体   繁体   中英

Environmental Variables in Digital Ocean Droplets

I have a Node.js app that I want running on a Digital Ocean droplet, however, I have a few environmental variables that I need to be using. Is it safe for me to create a.env file on it to store the variables? (If no, how do I go about doing this?) Because I know that services like Heroku have a 'configuration variable' setting on their dashboard, whereas Digital Ocean doesn't

Heroku is an app platform, not a VM, which is how they can inject your environment variables.

If it's on your machine, it's ok for you to create the file - it won't be accessible via the web (but it WILL be there).

Here's how to do it with the Digital Ocean App Platform ( https://docs.digitalocean.com/products/app-platform/how-to/use-environment-variables/ ), and here's how to do it with just a droplet ( https://www.digitalocean.com/community/questions/how-can-i-set-environment-variable-in-droplet-not-using-app )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM