-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for env variables within
nginx.conf
- rename `config/nginx/nginx.conf` into `config/nginx/nginx.conf.template` - expose (envsubst) the following `.env` variables into `nginx.conf.template`: - `WEBGIS_PUBLIC_HOSTNAME` - `WEBGIS_ADMIN_EMAIL` (new) - `WEBGIS_SSL` (new) - new folder `config/nginx/conf/` - simplify `README.md` steps related to HTTPS additional setup - refactor `run_certbot.sh` (ref: #77) -
- Loading branch information
Showing
13 changed files
with
67 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Public hostmane | ||
WEBGIS_PUBLIC_HOSTNAME=dev.g3wsuite.it | ||
WEBGIS_ADMIN_EMAIL=[email protected] | ||
# WEBGIS_SSL=1 | ||
|
||
# Shared volume mount (docker internal: shared-volume) | ||
# I suggest not to use the /tmp/ folder, /tmp/ folder is cleaned at each reboot | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
client_max_body_size 200M; | ||
client_body_timeout 600; | ||
|
||
upstream g3w_suite { | ||
ip_hash; | ||
server g3w-suite:8000; | ||
} | ||
|
||
# Expose some ENV variables in NGINX config from docker-compose.yml | ||
# ----------------------------------------------------------------- | ||
# Ref: docker-nginx/entrypoint/20-envsubst-on-templates.sh | ||
|
||
map "" $NGINX_SERVER_NAME { | ||
default $WEBGIS_PUBLIC_HOSTNAME; # ENVSUBST | ||
} | ||
|
||
map "" $NGINX_ADMIN_EMAIL { | ||
default $WEBGIS_ADMIN_EMAIL; # ENVSUBST | ||
} | ||
|
||
# HTTP(S) server | ||
include /etc/nginx/conf.d/conf/django$WEBGIS_SSL; # ENVSUBST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,12 +129,19 @@ services: | |
- "443:443" | ||
expose: | ||
- "8080" | ||
environment: | ||
- WEBGIS_PUBLIC_HOSTNAME=${WEBGIS_PUBLIC_HOSTNAME:-dev.g3wsuite.it} | ||
- WEBGIS_ADMIN_EMAIL=${WEBGIS_ADMIN_EMAIL:[email protected]} | ||
- WEBGIS_SSL=${WEBGIS_SSL:+_ssl} | ||
- NGINX_ENVSUBST_TEMPLATE_SUFFIX=.template | ||
- NGINX_ENVSUBST_TEMPLATE_DIR=/etc/nginx/conf.d | ||
volumes: | ||
- ${WEBGIS_DOCKER_SHARED_VOLUME}:/shared-volume | ||
- ${WEBGIS_DOCKER_SHARED_VOLUME}/var/www/.well-known:/var/www/.well-known | ||
- ${WEBGIS_DOCKER_SHARED_VOLUME}/certs/letsencrypt:/etc/letsencrypt:ro | ||
- ./config/g3w-suite/overrides/static:/shared-volume/static/overrides:ro | ||
- ./config/nginx:/etc/nginx/conf.d/:ro | ||
- ./config/nginx:/etc/nginx/conf.d/ | ||
- ./config/nginx/conf:/etc/nginx/conf.d/conf/:ro | ||
- ./config/nginx/html:/var/www/html:ro | ||
logging: | ||
driver: "json-file" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,12 +86,19 @@ services: | |
- "443:443" | ||
expose: | ||
- "8080" | ||
environment: | ||
- WEBGIS_PUBLIC_HOSTNAME=${WEBGIS_PUBLIC_HOSTNAME:-dev.g3wsuite.it} | ||
- WEBGIS_ADMIN_EMAIL=${WEBGIS_ADMIN_EMAIL:[email protected]} | ||
- WEBGIS_SSL=${WEBGIS_SSL:+_ssl} | ||
- NGINX_ENVSUBST_TEMPLATE_SUFFIX=.template | ||
- NGINX_ENVSUBST_TEMPLATE_DIR=/etc/nginx/conf.d | ||
volumes: | ||
- ${WEBGIS_DOCKER_SHARED_VOLUME}:/shared-volume | ||
- ${WEBGIS_DOCKER_SHARED_VOLUME}/var/www/.well-known:/var/www/.well-known | ||
- ${WEBGIS_DOCKER_SHARED_VOLUME}/certs/letsencrypt:/etc/letsencrypt:ro | ||
- ./config/g3w-suite/overrides/static:/shared-volume/static/overrides:ro | ||
- ./config/nginx:/etc/nginx/conf.d/:ro | ||
- ./config/nginx:/etc/nginx/conf.d/ | ||
- ./config/nginx/conf:/etc/nginx/conf.d/conf/:ro | ||
- ./config/nginx/html:/var/www/html:ro | ||
logging: | ||
driver: "json-file" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters