environment-variables
Forcing cURL to get a password from the environment
This bash solution appears to best fit my needs. It’s decently secure, portable, and fast. #!/bin/bash SRV=”example.com” URL=”https://$SRV/path” curl –netrc-file <(cat <<<“machine $SRV login $USER password $PASSWORD”) “$URL” This uses process substitution (<( command ) runs command in a sub-shell to populate a file descriptor to be handed as a “file” to the parent command, … Read more
How to load environment variables in the Rails console?
About a year ago, the “run” command was added to foreman ref: https://github.com/ddollar/foreman/pull/121 You can use it as follow: foreman run rails console or foreman run rake db:migrate
Docker-Compose Environment-Variables blank string
Although the other answers are both correct they do not highlight the underlying misunderstanding here enough: With the env_file option you can specify a file with variables to be injected into the environment in the container. Using variable substitution in the docker-compose.yml you can access variables in the environment of the docker-compose command, i.e. on … Read more
Using multi-line value in .env file in docker-compose
If you don’t mind not using the .env file (maybe that environment variable is used only in a single container). You can define environment variables directly inside docker-compose.yml and there, you can make full use of YAML formatting options. I.e.: myservice: build: . environment: SSH_KEY: > ——— WHATEVER ———- randomkeybase64thingforyourse rvice ——- END WHATEVER ——– … Read more
How to Use Environment Variables in a .env file to fill out other environment variable in the same .env file
You can actually do it like this (at least in vlucas/dotenv package (php), not sure about others, please check it yourself) MAIL_NAME=${MAIL_FROM} Read more about it here
How do I set environment variables during Docker build process?
ARG is for setting environment variables which are used during the docker build process – they are not present in the final image, which is why you don’t see them when you use docker run. You use ARG for settings that are only relevant when the image is being built, and aren’t needed by containers … Read more
How can I set an environment variable in node.js?
You can set your environment variables in process.env: process.env[‘VARIABLE’] = ‘value’; -OR- process.env.VARIABLE = ‘value’; Node should take care of the platform specifics.