paint-brush
How To Use Environment Variables In Docker Compose Fileby@ifomin
6,271 reads
6,271 reads

How To Use Environment Variables In Docker Compose File

by Igor Fomin1mFebruary 26th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Environment variables work great with docker compose. If I want to use different credentials on different servers, environment variables can be used. Credentials to redis-commander will be admin/qwerty. The environment variables get picked up automatically when running " docker-compose up -d", there is no need to specify it somehow. If I create.env file next to my yml file and put the following inside, credentials to test/1234: REDIS_USER=test; Redis_PASSWORD=1234.

Company Mentioned

Mention Thumbnail
featured image - How To Use Environment Variables In Docker Compose File
Igor Fomin HackerNoon profile picture
Igor Fomin

Igor Fomin

@ifomin

Full stack web developer, tech lead, project manager

About @ifomin
LEARN MORE ABOUT @IFOMIN'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Igor Fomin HackerNoon profile picture
Igor Fomin@ifomin
Full stack web developer, tech lead, project manager

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite