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?

Dockerでwebサービス待受けポートを変更指定しよう

Last updated at Posted at 2026-01-07

複数webサービスを動かす場合、80ポートで競合してしまいます。
ポート番号を指定し調整してあげることで複数webサービスを同時に起動しアクセスができます。
ローカルDifyでは、[.env]ファイルに変数が纏めてあるのでここを変更します。

内部待ち受けポート確認
docker exec -it docker-web-1 netstat -lntp
dockerを停止する
docker compose down
.envファイルを編集する
nano .env

該当個所を探し変更する。

.env
# ------------------------------
# Docker Compose Service Expose Host Port Configurations
# ------------------------------
EXPOSE_NGINX_PORT=80
EXPOSE_NGINX_SSL_PORT=443

EXPOSE_NGINX_PORT=80
 ↓ 任意のポート「8080」に変更
EXPOSE_NGINX_PORT=8080

・「Ctrl+o」→[Enter]保存
・「Ctrl+x」閉じる

docker起動
docker compose up -d

ブラウザでアクセスし表示できることを確認
http://[address]:8080

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?