From 581a5e13fe11f05b8a6f077c282cc8a2f7677869 Mon Sep 17 00:00:00 2001 From: Ichiro TAKAHASHI Date: Fri, 9 Aug 2024 10:21:48 +0900 Subject: [PATCH 1/3] =?UTF-8?q?issue44:=20nginx=20=E3=81=AE=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=A7=E7=92=B0?= =?UTF-8?q?=E5=A2=83=E5=A4=89=E6=95=B0=E3=82=92=E5=B1=95=E9=96=8B=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=BE?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ke2/services/nginx.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ke2/services/nginx.yml b/ke2/services/nginx.yml index 91ed0f0..4bd073d 100644 --- a/ke2/services/nginx.yml +++ b/ke2/services/nginx.yml @@ -4,9 +4,11 @@ services: hostname: nx-${HOSTNAME} environment: - TZ=${TZ:-Asia/Tokyo} + - NGINX_ENVSUBST_FILTER=^KOMPIRA configs: + # MEMO: /etc/nginx/templates/*.template は起動時に環境変数が展開されて /etc/nginx/conf.d/* に書き出される - source: nginx-config - target: /etc/nginx/conf.d/default.conf + target: /etc/nginx/templates/default.conf.template volumes: - ${KOMPIRA_VAR_DIR:-kompira_var}:/var/opt/kompira - ${KOMPIRA_SSL_DIR:-../../ssl}:/etc/nginx/ssl:ro From c532e8289d1f8a164da1cffa55c97ea8d29e00b9 Mon Sep 17 00:00:00 2001 From: Ichiro TAKAHASHI Date: Fri, 9 Aug 2024 10:22:32 +0900 Subject: [PATCH 2/3] =?UTF-8?q?issue44:=20nginx=20=E3=81=AE=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E3=81=A7=20kompira=20=E3=82=B5=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=82=92=E7=92=B0=E5=A2=83=E5=A4=89=E6=95=B0=20KOMPIRA=5FHOST:?= =?UTF-8?q?KOMPIRA=5FPORT=20=E3=81=A7=E6=8C=87=E5=AE=9A=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=BE=E3=81=97?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/nginx.conf | 3 ++- ke2/services/nginx.yml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configs/nginx.conf b/configs/nginx.conf index f52410d..08b1431 100644 --- a/configs/nginx.conf +++ b/configs/nginx.conf @@ -1,5 +1,6 @@ +# kompira サーバの設定 (環境変数は起動時に envsubst で置換する) upstream django { - server kompira:8000; + server ${KOMPIRA_HOST}:${KOMPIRA_PORT}; } # uwsgi タイムアウトの設定 diff --git a/ke2/services/nginx.yml b/ke2/services/nginx.yml index 4bd073d..23652fd 100644 --- a/ke2/services/nginx.yml +++ b/ke2/services/nginx.yml @@ -5,6 +5,8 @@ services: environment: - TZ=${TZ:-Asia/Tokyo} - NGINX_ENVSUBST_FILTER=^KOMPIRA + - KOMPIRA_HOST=${KOMPIRA_HOST:-kompira} + - KOMPIRA_PORT=${KOMPIRA_PORT:-8000} configs: # MEMO: /etc/nginx/templates/*.template は起動時に環境変数が展開されて /etc/nginx/conf.d/* に書き出される - source: nginx-config From 1121997702f1f4487e9d1ff0ba29e4d5451989e4 Mon Sep 17 00:00:00 2001 From: Ichiro TAKAHASHI Date: Tue, 20 Aug 2024 15:44:06 +0900 Subject: [PATCH 3/3] Update ChangeLog for #44 --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 60d9c94..e9b89cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2024-08-20 Ichiro TAKAHASHI + * 環境変数 ${KOMPIRA_HOST}, ${KOMPIRA_PORT} で nginx の upstream django サーバを指定できるようにしました。(#44) + * docker-compose-plugin について v2.24.6 以上が必要であることを追記しました。(#41) 2024-08-01 Ichiro TAKAHASHI