0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Makefile で環境ごとに違う docker-compose.yml を利用する

Last updated at Posted at 2020-12-28

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

コマンド実行の時は

$ make up e=production

とかを叩く。

おしまい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?