2
Talk personal, I’m starting to use Docker, but I still have many questions and one of them is how to point a domain to a specific container.
First I created a Container with a php and apache image in the version I needed and made the link with two other containers
docker run -i -t -p 8080:80 --name apache-php --link postgresdb:postgresdb --link mysqldb:mysqldb -v /home/volumes/html:/var/www/html php:5.6-apache /bin/bash
As I use Linode hosting, I followed this tutorial to set up my domain in the container apache and it worked as expected so far.
"Name-based Virtual Hosts": https://www.linode.com/docs/websites/hosting-a-website
But obviously it is necessary to do some more configuration, because if I access my domain by setting the port I can see the page (example.com:8080), but if I do not put the port, the page does not open (example.com)
I read several tutorials, questions and etc and came to the conclusion that I would need to set up a proxy in apache for this, so I arrived at the following configuration file:
example.com.conf:
# domain: example.com
# public: /var/www/html/example.com/public_html/
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin [email protected]
ServerName example.com
ServerAlias example.com www.example.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /var/www/html/example.com/public_html
# Log file locations
LogLevel warn
ErrorLog /var/www/html/example.com/log/error.log
CustomLog /var/www/html/example.com/log/access.log combined
ProxyRequests On
ProxyVia On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyRequests Off
ProxyPass / http://www.example.com:8080
</VirtualHost>
But it still doesn’t work, so neither does the domain with the door work.
The question is, can anyone help me finally solve this problem? rs