Answer the question
In order to leave comments, you need to log in
How to make default docker-compose variable?
In general, I didn’t find anything particularly how to make ${web:-$TAG} so that if there is no web variable, then it would then be equal to the TAG variable , TAG does not perceive it as a variable, but simply as text.
docker-compose.yml
version: '3.4'
x-variables: &config
version: ${TAG}
services:
postgres:
image: postgres:${web:-$TAG}
restart: always
environment:
<<: *config
volumes:
- "fastgate_db:/var/lib/postgresql/data"
ports:
- "5432:5432"
TAG=6.1.0
web=DEVELOP
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question