Skip to content

Commit 9bf0974

Browse files
nicolailangevertramos
authored andcommitted
Support for running on Synology DSM Nas and configureable ports for docker host (#110)
* Added support for configuring listener port on docker host and instructions for running on Synology DSM Nas
1 parent 2ceaab9 commit 9bf0974

File tree

4 files changed

+40
-5
lines changed

4 files changed

+40
-5
lines changed

.env.sample

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,11 @@ NGINX_FILES_PATH=./nginx-data
8585
#NGINX_LETSENCRYPT_LOG_DRIVER=json-file
8686
#NGINX_LETSENCRYPT_LOG_MAX_SIZE=2m
8787
#NGINX_LETSENCRYPT_LOG_MAX_FILE=10
88+
89+
#
90+
# Set the local exposed ports for http and https on the Host
91+
#
92+
# NOTE: The default values are 80 and 443, only change this options if you really know what you are doing
93+
#
94+
#DOCKER_HTTP=80
95+
#DOCKER_HTTPS=443

Docs/HOWTO-Synlogy.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Port mapping
2+
Synology default installs a web server on port 80 blocking certificate generation.
3+
4+
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:
5+
6+
#
7+
# Set the local exposed ports for http and https - this will allow you to run with a legacy web
8+
# server already installed for local use
9+
#
10+
# NOTE: For this to function your internet router must forward the official ports to the mapped ports -
11+
# in this example external port 80 to docker host 81 and external port 443 to docker host 444
12+
#
13+
DOCKER_HTTP=81
14+
DOCKER_HTTPS=444
15+
16+
## File permissions
17+
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)
18+
19+
mkdir -p data/certs
20+
mkdir data/htpasswd
21+
mkdir data/conf.d
22+
mkdir data/vhost.d
23+
mkdir data/html
24+
chgrp -R 101 data
25+
chmod -R g+rwx data
26+
27+
Contributed by https://github.com/nicolailang/

docker-compose-multiple-networks.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ services:
77
container_name: ${NGINX_WEB:-nginx-web}
88
restart: always
99
ports:
10-
- "${IP:-0.0.0.0}:80:80"
11-
- "${IP:-0.0.0.0}:443:443"
12-
volumes:
10+
- "${IP:-0.0.0.0}:${DOCKER_HTTP:-80}:80"
11+
- "${IP:-0.0.0.0}:${DOCKER_HTTPS:-443}:443"
12+
volumes:
1313
- ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d
1414
- ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d
1515
- ${NGINX_FILES_PATH:-./data}/html:/usr/share/nginx/html

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ services:
77
container_name: ${NGINX_WEB:-nginx-web}
88
restart: always
99
ports:
10-
- "${IP:-0.0.0.0}:80:80"
11-
- "${IP:-0.0.0.0}:443:443"
10+
- "${IP:-0.0.0.0}:${DOCKER_HTTP:-80}:80"
11+
- "${IP:-0.0.0.0}:${DOCKER_HTTPS:-443}:443"
1212
volumes:
1313
- ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d
1414
- ${NGINX_FILES_PATH:-./data}/vhost.d:/etc/nginx/vhost.d

0 commit comments

Comments
 (0)