From 8a4e398ef0c1171e40e76a235506ad332805d57b Mon Sep 17 00:00:00 2001
From: Alexey Kuklin <alex@kuklin.eu>
Date: Fri, 3 Jan 2020 03:19:48 +0200
Subject: [PATCH] DirectoryIndex fix, dockerignore and file relocation

---
 .dockerignore                                 |  3 ++
 Dockerfile                                    |  3 +-
 docker/000-default.conf                       | 33 +++++++++++++++++++
 .../apache2-foreground                        |  0
 4 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 .dockerignore
 create mode 100644 docker/000-default.conf
 rename apache2-foreground => docker/apache2-foreground (100%)

diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 000000000..ff4c73853
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,3 @@
+docker/*
+Dockerfile
+.gitlab-ci.yml
diff --git a/Dockerfile b/Dockerfile
index 73cbc720e..8345db55e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,7 +4,8 @@ RUN apt-get update && apt-get install -y apache2 libapache2-mod-php7.3 php7.3-my
 
 ADD . /var/www/html/.
 
-COPY apache2-foreground /usr/local/bin/
+COPY docker/apache2-foreground /usr/local/bin/
+COPY docker/000-default.conf /etc/apache2/sites-available/000-default.conf 
 WORKDIR /var/www/html
 
 EXPOSE 80
diff --git a/docker/000-default.conf b/docker/000-default.conf
new file mode 100644
index 000000000..51f034c00
--- /dev/null
+++ b/docker/000-default.conf
@@ -0,0 +1,33 @@
+<VirtualHost *:80>
+	# The ServerName directive sets the request scheme, hostname and port that
+	# the server uses to identify itself. This is used when creating
+	# redirection URLs. In the context of virtual hosts, the ServerName
+	# specifies what hostname must appear in the request's Host: header to
+	# match this virtual host. For the default virtual host (this file) this
+	# value is not decisive as it is used as a last resort host regardless.
+	# However, you must set it for any further virtual host explicitly.
+	#ServerName www.example.com
+
+	ServerAdmin webmaster@localhost
+	DocumentRoot /var/www/html
+
+	DirectoryIndex index.php
+
+	# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
+	# error, crit, alert, emerg.
+	# It is also possible to configure the loglevel for particular
+	# modules, e.g.
+	#LogLevel info ssl:warn
+
+	ErrorLog ${APACHE_LOG_DIR}/error.log
+	CustomLog ${APACHE_LOG_DIR}/access.log combined
+
+	# For most configuration files from conf-available/, which are
+	# enabled or disabled at a global level, it is possible to
+	# include a line for only one particular virtual host. For example the
+	# following line enables the CGI configuration for this host only
+	# after it has been globally disabled with "a2disconf".
+	#Include conf-available/serve-cgi-bin.conf
+</VirtualHost>
+
+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
diff --git a/apache2-foreground b/docker/apache2-foreground
similarity index 100%
rename from apache2-foreground
rename to docker/apache2-foreground
-- 
GitLab