Testing docker
WaaromZoMoeilijk opened this issue · 4 comments
Hey mate thanks for this easy docker setup. Had a hard time to get the official one running. Could you help me, i need to verify if the docker build works.
Connected 2 devices and hit sync on 1 and after a minute or so on the other, but nothing sync's.
I have the docker running locally on my server and i want to port forward my router :5000 to :5000 so I can sync on the go. Perhaps with an extra nginx SSL layer on top. How is your SSL been taken care of?
Thanks and kind regards
Ezra
Edit: would it also need to be https://IPADDRESS:5000/token/1.0/sync/1.5
instead of https://IPADDRESS/token/1.0/sync/1.5:5000
since we need to connect to the docker :5000 instead of the webserver running on the host.
Hi,
In my setup, I have a nginx as reverse proxy for the SSL layer. So I'm using this config:
server {
listen 443 http2;
server_name sync.example.com;
# ssl stuff
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
proxy_read_timeout 120;
proxy_connect_timeout 10;
proxy_pass http://172.17.0.2:5000/
}
}
Where 172.17.0.2 is the local IP of the container.
By doing that, I'm using the 443 port of my server with a subdomain. If you want to use the 5000 port then change the listen directive.
So in my setup I don't do any port forwarding with docker (no -p 5000:5000).
If you specify an address with https when starting the docker then you need ssl/tls.
You're right regarding the port, I'll add that on the README.md
Yeah right then i get why its not working. Could you share your docker run/create command?
Thanks
The build command:
docker build -t sync .
The run command:
docker run --init -d --name sync -e URL=https://sync.example.com sync
Closing. Feel free to re-open the issue if you still have problems.