0
2

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.

docker-compose で 環境変数で port を切り替える例 ( #docker )

0
Last updated at Posted at 2020-04-16

docker-copose.yml

  • 変数を指定する
  • docker container の 3000 が expose されている状態
  • デフォルトでは 4000番 port を外部に公開する例
version: '3.0'

services:
  app:
    ...(色々省略)...
    ports:
      - ${APP_PORT:-4000}:3000

.env

.env ファイルに以下を設定

APP_PORT=5000

実行

docker-compose up

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

0
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?