I have NGINX set up on Centos 7.5, listening on port 80, and directing the traffic to a Gunicorn server. That is the main purpose of this server, and these are are locally installed applications, no containers so far.
Now, I would like to run some services within Docker containers, and have different subdomains (or perhaps ports) redirect the traffic to the relevant containers.
A specific example - SVN server
I'm very new to the whole Docker concept, and the lack of specific documentation for some containers really confuses me. I managed to make some progress with this SVN server container. This is the command I use:
docker run -d --name svn-server -p 80:80 -p 3960:3960 -v /home/svn:/home/svn elleflorio/svn-server
This is what I have so far:
- The SVN server is accessible via http://mysite/svn (port 80).
- The container binds successfully to the local directory, keeping the repository data even if the container is deleted, which is great.
- I can run commands within the container, create users, add repositories.
These are the problems:
- I had to stop NGINX, since it also needs port 80.
- No success so far in getting the container to run on a different port, it didn't work when I simply tried to change the
-p
parameter; I tried temporarily disabling SELinux which didn't help. - If I could run the container on a different port, I could redirect traffic from a subdomain to that port, but I'm sure there's a better practice for working with Docker containers.
- If I manage to get this to work - how do I make sure the container is restarted upon host reboot?