diff --git a/.env.sample b/.env.sample index aa68c74..015ac48 100644 --- a/.env.sample +++ b/.env.sample @@ -85,3 +85,11 @@ NGINX_FILES_PATH=./nginx-data #NGINX_LETSENCRYPT_LOG_DRIVER=json-file #NGINX_LETSENCRYPT_LOG_MAX_SIZE=2m #NGINX_LETSENCRYPT_LOG_MAX_FILE=10 + +# +# Set the local exposed ports for http and https on the Host +# +# NOTE: The default values are 80 and 443, only change this options if you really know what you are doing +# +#DOCKER_HTTP=80 +#DOCKER_HTTPS=443 diff --git a/Docs/HOWTO-Synlogy.md b/Docs/HOWTO-Synlogy.md new file mode 100755 index 0000000..4c456f8 --- /dev/null +++ b/Docs/HOWTO-Synlogy.md @@ -0,0 +1,27 @@ +## Port mapping +Synology default installs a web server on port 80 blocking certificate generation. + +To circumvent this - if you do not need external access to the default web server (and you should not expose it anyway) configure your .env to use alternative ports and your router to forward the external official port to the alternative internal ports: + +# +# Set the local exposed ports for http and https - this will allow you to run with a legacy web +# server already installed for local use +# +# NOTE: For this to function your internet router must forward the official ports to the mapped ports - +# in this example external port 80 to docker host 81 and external port 443 to docker host 444 +# +DOCKER_HTTP=81 +DOCKER_HTTPS=444 + +## File permissions +To setup the needed configuration directoties and proper permissions run the below commands (assuming default ./data is where you have your catalog for persistent files) + +mkdir -p data/certs +mkdir data/htpasswd +mkdir data/conf.d +mkdir data/vhost.d +mkdir data/html +chgrp -R 101 data +chmod -R g+rwx data + +Contributed by https://github.com/nicolailang/ diff --git a/docker-compose-multiple-networks.yml b/docker-compose-multiple-networks.yml index 09141f2..2d4440e 100644 --- a/docker-compose-multiple-networks.yml +++ b/docker-compose-multiple-networks.yml @@ -7,9 +7,9 @@ services: container_name: ${NGINX_WEB:-nginx-web} restart: always ports: - - "${IP:-0.0.0.0}:80:80" - - "${IP:-0.0.0.0}:443:443" - volumes: + - "${IP:-0.0.0.0}:${DOCKER_HTTP:-80}:80" + - "${IP:-0.0.0.0}:${DOCKER_HTTPS:-443}:443" + volumes: - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d - ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d - ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html diff --git a/docker-compose.yml b/docker-compose.yml index 230146e..377a000 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,8 +7,8 @@ services: container_name: ${NGINX_WEB:-nginx-web} restart: always ports: - - "${IP:-0.0.0.0}:80:80" - - "${IP:-0.0.0.0}:443:443" + - "${IP:-0.0.0.0}:${DOCKER_HTTP:-80}:80" + - "${IP:-0.0.0.0}:${DOCKER_HTTPS:-443}:443" volumes: - ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d - ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d