Docker mapping not created file/folder from your dir to container will auto create them in container for example :
volumes:
- ./httpd/httpd.conf:/usr/local/apache2/conf/httpd.conf
- ./httpd/sites:/usr/local/apache2/conf/sites
- ./httpd/certs/server.crt:/usr/local/apache2/conf/server.crt
- ./httpd/certs/server.key:/usr/local/apache2/conf/server.key
- ./httpd/custom_log:/usr/local/apache2/custom_log
sites folder, custom_log folder will be created, and server.crt, server.key files will be created in container
For multiple virtual host,
in your volume mapped to container, just create multiple files with different domain, and apache will match based on current site domain name for example :
in httpd/sites:
mysiteA.conf
<virtualHost *:80>
ServerName mysiteA.com
...................
mysiteB.conf
<virtualHost *:80>
ServerName mysiteB.com
..................
dockker-compose.yml
volumes:
- ./httpd/sites:/usr/local/apache2/conf/sites
For apache log files, in your custom log folder:
custom_log:
mysiteA.access.log
myisteA.error.log
docker-compose.yml
volumes:
- ./httpd/custom_log:/usr/local/apache2/custom_log
No comments:
Post a Comment