Solved How to access docker from external site

Currently reading
Solved How to access docker from external site

78
11
NAS
DS412+
Dears,

I am building a Django Website from Docker, which is in bridge mode and running. But it can only ping-ed within SSH in SynoNAS. I read port mapping would be a nice solution, but how? e.g. within my home network it would look like:
http(s)://DSM:12345 => my Django website in Docker

appreciate any thoughts and sharing... thanks!
@Telos: I read your reply there, would you shine a light ;-)?

(PS: this is not the DSM app: webstation, but could be linked together later for WWW.)

/BR
 

Rusty

Moderator
NAS Support
2,394
709
www.blackvoid.club
NAS
DS412+, DS718+, DS918+, 2x RS3614RPxs+ with expansions
Router
  1. RT1900ac
  2. RT2600ac
  3. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
You could run anything in a Docker via reverse proxy and access it outside your lan
 

fredbert

Moderator
NAS Support
Subscriber
1,627
676
NAS
DS1520+, DS218+, DS215j
Router
  1. RT2600ac
  2. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
78
11
NAS
DS412+
@Rusty @fredbert thanks for your quick response.

what's reverse proxy?I feel reluctant to install any new packages or services...

maybe I didn't explain my question more clearly... My 1st goal is to access docker(my website) outside of SynoNAS(not yet Internet). For this, I would guess some setting need to be changed, e.g.

  • within docker(bridge mode): edit /etc/host.??? to map/assign my Django website IP( e.g. 127.0.0.1) to docker's bridged IP;
  • within DSM: edit e.g. /etc/host? to map NAS_IP: port to Docker's IP: port
Maybe something like that...
 
I am afraid this on is about publishing the container port on the host. The OP's posts are a little bit to ambigous...
If I am right, stop your container, edit it, change to the "Port Setting" tab and add your port mappings.

Since you seem to have created the image yourself, I hope you declared the port your application is listening on with EXPOSE. All ports declared as EXPOSE will be used as container ports and assigned to random host ports. Just change the random host ports to whatever you like.
 

fredbert

Moderator
NAS Support
Subscriber
1,627
676
NAS
DS1520+, DS218+, DS215j
Router
  1. RT2600ac
  2. MR2200ac
Operating system
  1. macOS
Mobile operating system
  1. iOS
A forward proxy server is one that internal users send web requests to (or transparently intercepts them) and creates an onward request to the destination web server. This allows things like content filtering and anti-virus scanning to be applied, also it can apply different Internet access policies based on device or authenticated user/group. Most businesses will apply some form of forward proxy service.

A reverse proxy server is placed in front of web servers and will receive incoming requests from Internet (and other) web clients. There are various reasons to do this such as adapting (rewriting) the URL or parts of it so that in meets the structure used by internal/protected web servers. Other reasons can be to cache content and take load off the web servers.

The DSM Reverse Proxy service is already installed and accessed via Control Panel -> Application Portal page: see the Reverse Proxy tab.

My 1st goal is to access docker(my website) outside of SynoNAS(not yet Internet).
This is done by doing this...
Provided you changed the mapped DSM port from 'auto' to 12345 ...
Stop your container and Edit it. Got to the Port Settings tab and change the local port from 'auto' to some number, i.e. 12345. Now the Container port will change whenever you stop/start it but the DSM IP's port will be fixed to 12345.
 
78
11
NAS
DS412+
@fredbert THNAKS!

A forward proxy server is one that internal users send web requests to (or transparently intercepts them) and creates an onward request to the destination web server. This allows things like content filtering and anti-virus scanning to be applied, also it can apply different Internet access policies based on device or authenticated user/group. Most businesses will apply some form of forward proxy service.

A reverse proxy server is placed in front of web servers and will receive incoming requests from Internet (and other) web clients. There are various reasons to do this such as adapting (rewriting) the URL or parts of it so that in meets the structure used by internal/protected web servers. Other reasons can be to cache content and take load off the web servers.

The DSM Reverse Proxy service is already installed and accessed via Control Panel -> Application Portal page: see the Reverse Proxy tab.


This is done by doing this...

Stop your container and Edit it. Got to the Port Settings tab and change the local port from 'auto' to some number, i.e. 12345. Now the Container port will change whenever you stop/start it but the DSM IP's port will be fixed to 12345.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Similar threads

Similar threads

Trending threads

Top