diff --git a/docker_dev/Dockerfile b/docker_dev/Dockerfile
index 60a6a66..ba72d62 100644
--- a/docker_dev/Dockerfile
+++ b/docker_dev/Dockerfile
@@ -12,6 +12,7 @@ RUN chmod -R a+r ./vendor
RUN a2enmod rewrite
RUN a2enmod headers
+RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli
COPY . .
RUN chmod -R a+r $(ls -I vendor)
diff --git a/docker_dev/MysqlDockerfile b/docker_dev/MysqlDockerfile
new file mode 100644
index 0000000..be3c855
--- /dev/null
+++ b/docker_dev/MysqlDockerfile
@@ -0,0 +1,4 @@
+FROM mysql:8.0-debian
+
+WORKDIR /docker-entrypoint-initdb.d
+COPY mysql_schema.sql ./
\ No newline at end of file
diff --git a/docker_dev/compose.yaml b/docker_dev/compose.yaml
index 5e8c99b..4ab1353 100644
--- a/docker_dev/compose.yaml
+++ b/docker_dev/compose.yaml
@@ -11,9 +11,12 @@ services:
action: rebuild
- path: ../.
action: sync
- target: /usr/local/apache2/htdocs/
+ target: /var/www/html
+ ignore:
+ - ../.git
mysql:
- image: mysql:8.0-debian
+ build:
+ dockerfile: MysqlDockerfile
# NOTE: use of "mysql_native_password" is not recommended: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password
# (this is just an example, not intended to be a production configuration)
command: --default-authentication-plugin=mysql_native_password
diff --git a/docker_dev/mysql_schema.sql b/docker_dev/mysql_schema.sql
new file mode 100644
index 0000000..e69de29
diff --git a/router.php b/router.php
index 9e2c99d..57a3318 100644
--- a/router.php
+++ b/router.php
@@ -2,6 +2,17 @@
require_once 'vendor/autoload.php';
+
+$sql = mysqli_connect('mysql', 'root', 'example', 'mysql');
+
+if (!$sql)
+{
+ echo 'Connection failed
';
+ echo 'Error number: ' . mysqli_connect_errno() . '
';
+ echo 'Error message: ' . mysqli_connect_error() . '
';
+ die();
+}
+
$loader = new \Twig\Loader\FilesystemLoader(['./templates', './user_content']);
$twig = new \Twig\Environment($loader,['debug' => true]);