From 37ed904f1a588de09993d76ddeee8447bcc9a767 Mon Sep 17 00:00:00 2001 From: hchs Date: Thu, 9 Mar 2017 10:26:47 +0800 Subject: [PATCH] add vhost example --- apache2/Dockerfile | 2 ++ apache2/sites/.gitignore | 3 +++ apache2/sites/default.apache.conf | 16 ++++++++++++++++ apache2/sites/sample.conf.example | 16 ++++++++++++++++ apache2/vhost.conf | 1 + docker-compose.yml | 1 + 6 files changed, 39 insertions(+) create mode 100644 apache2/sites/.gitignore create mode 100644 apache2/sites/default.apache.conf create mode 100644 apache2/sites/sample.conf.example create mode 100644 apache2/vhost.conf diff --git a/apache2/Dockerfile b/apache2/Dockerfile index 569ba9f3..09cc63e2 100644 --- a/apache2/Dockerfile +++ b/apache2/Dockerfile @@ -12,6 +12,8 @@ EXPOSE 80 443 WORKDIR /var/www/public +ADD vhost.conf /etc/apache2/sites-enabled/vhost.conf + ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"] CMD ["supervisord"] diff --git a/apache2/sites/.gitignore b/apache2/sites/.gitignore new file mode 100644 index 00000000..f1f9322e --- /dev/null +++ b/apache2/sites/.gitignore @@ -0,0 +1,3 @@ +*.conf +!default.conf +!default.apache.conf diff --git a/apache2/sites/default.apache.conf b/apache2/sites/default.apache.conf new file mode 100644 index 00000000..2d15dafc --- /dev/null +++ b/apache2/sites/default.apache.conf @@ -0,0 +1,16 @@ + + ServerName laradock.dev + DocumentRoot /var/www/html/ + Options Indexes FollowSymLinks + + + AllowOverride All + + Allow from all + + = 2.4> + Require all granted + + + + diff --git a/apache2/sites/sample.conf.example b/apache2/sites/sample.conf.example new file mode 100644 index 00000000..48a132e0 --- /dev/null +++ b/apache2/sites/sample.conf.example @@ -0,0 +1,16 @@ + + ServerName sample.dev + DocumentRoot /var/www/sample/public/ + Options Indexes FollowSymLinks + + + AllowOverride All + + Allow from all + + = 2.4> + Require all granted + + + + diff --git a/apache2/vhost.conf b/apache2/vhost.conf new file mode 100644 index 00000000..2352bf82 --- /dev/null +++ b/apache2/vhost.conf @@ -0,0 +1 @@ +Include /etc/apache2/sites-available/*.conf diff --git a/docker-compose.yml b/docker-compose.yml index 283d7770..38a5209c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -104,6 +104,7 @@ services: - applications volumes: - ./logs/apache2:/var/log/apache2 + - ./apache2/sites:/etc/apache2/sites-available ports: - "80:80" - "443:443"