Use docker-compose.yml which is different for each environment in Makefile


ENV=local

pre:
ifdef e
ENV=${e}
endif

set-env :=\
	export ENV=$(ENV) ;\
	export COMPOSE_PATH_SEPARATOR=: ;\
	export COMPOSE_FILE=docker-compose.$(ENV).yml ;

up: pre
	$(set-env)\
	docker-compose up -d

When executing a command

$ make up e=production

Hit something like that.

That's it.

Recommended Posts

Use docker-compose.yml which is different for each environment in Makefile
Use different TransactionManager for metadata and step in spring-batch
Use MailHog for checking emails in the development environment (using Docker)
Best practice to change settings for each environment in iOS app (Swift)
[Docker] Use environment variables in Nginx conf
Use docker in proxy environment on ubuntu 20.04.1
[Java] for Each and sorted in Lambda
Use "Rhino" which runs JavaScript in Java
Use selenium (Firefox) in Ruby in WSL environment
Use selenium (Chrome) in Ruby in WSL environment
How to use environment variables in RubyOnRails