How To Use Environment Variables In Docker Compose File

Written by ifomin | Published 2020/02/26
Tech Story Tags: docker | docker-compose | environment-variables | software-development | docker-env | devops | docker-compose-file | devops-docker | web-monetization

TLDR 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.via the TL;DR App

no story

Written by ifomin | Full stack web developer, tech lead, project manager
Published by HackerNoon on 2020/02/26