Skip to content

Commit

Permalink
Merge pull request #45 from fixpoint/feature/issue44-docker-config-en…
Browse files Browse the repository at this point in the history
…vsubst

Feature/issue44 docker config envsubst
  • Loading branch information
tichi73 authored Aug 20, 2024
2 parents 03caace + 1121997 commit a7cafac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
2024-08-20 Ichiro TAKAHASHI <[email protected]>

* 環境変数 ${KOMPIRA_HOST}, ${KOMPIRA_PORT} で nginx の upstream django サーバを指定できるようにしました。(#44)

* docker-compose-plugin について v2.24.6 以上が必要であることを追記しました。(#41)

2024-08-01 Ichiro TAKAHASHI <[email protected]>
Expand Down
3 changes: 2 additions & 1 deletion configs/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# kompira サーバの設定 (環境変数は起動時に envsubst で置換する)
upstream django {
server kompira:8000;
server ${KOMPIRA_HOST}:${KOMPIRA_PORT};
}

# uwsgi タイムアウトの設定
Expand Down
6 changes: 5 additions & 1 deletion ke2/services/nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ services:
hostname: nx-${HOSTNAME}
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
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
Expand Down

0 comments on commit a7cafac

Please sign in to comment.