Skip to content

Commit

Permalink
first version of mariadb install
Browse files Browse the repository at this point in the history
  • Loading branch information
rossriley committed Aug 29, 2017
1 parent 2c1ef0e commit 2008ccf
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 0 deletions.
28 changes: 28 additions & 0 deletions 3.4/mariadb/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM php:7.1-apache
MAINTAINER Ross Riley "[email protected]"

RUN apt-get update && apt-get install -y libpq-dev git libpng-dev libjpeg62-turbo-dev libfreetype6-dev wget libxrender1 libfontconfig1
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
docker-php-ext-install -j$(nproc) gd && \
docker-php-ext-install pdo_mysql && \
docker-php-ext-install exif && \
docker-php-ext-install zip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN a2enmod headers
RUN a2enmod rewrite

RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer

# Copy across the local files to the root directory
ADD . /var/www/html/
ADD ./server/apache-vhost.conf /etc/apache2/sites-enabled/
RUN rm /etc/apache2/sites-enabled/000-default.conf
ADD ./server/php-config.ini /usr/local/etc/php/conf.d/php-config.ini
RUN chmod +x /var/www/html/start.sh

RUN cd /var/www/html && composer install

CMD ["/var/www/html/start.sh"]
11 changes: 11 additions & 0 deletions 3.4/mariadb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Bolt Image with adjustments to be capable of running MySQL/MariaDB

#### Note this is still an early WIP and should not be used apart from for testing.

### Getting Started

You need to create a `docker-compose.yml` file and a `.env` file for your db credentials.

Then add this image and the relevant MySQL/MariaDB image as services and start.

#### Example docker-compose file
5 changes: 5 additions & 0 deletions 3.4/mariadb/app/config/config_local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
database:
driver: mysql
username: %APP_USER%
password: %APP_PASSWORD%
databasename: %APP_USER%
26 changes: 26 additions & 0 deletions 3.4/mariadb/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "rossriley/docker-bolt",
"require": {
"bolt/bolt": "dev-3.4@dev"
},
"authors": [
{
"name": "Ross Riley",
"email": "[email protected]"
}
],
"minimum-stability": "beta",
"prefer-stable": true,
"scripts": {
"post-install-cmd": [
"Bolt\\Composer\\ScriptHandler::installAssets"
],
"post-update-cmd": [
"Bolt\\Composer\\ScriptHandler::updateProject",
"Bolt\\Composer\\ScriptHandler::installAssets"
]
},
"extra": {
"bolt-web-dir": "./public"
}
}
Empty file added 3.4/mariadb/public/.htaccess
Empty file.
12 changes: 12 additions & 0 deletions 3.4/mariadb/public/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

/** @var Silex\Application|false $app */
$app = require __DIR__ . '/../vendor/bolt/bolt/app/web.php';

// If we're running PHP's built-in webserver, `web.php` returns `false`,
// meaning the path is a file. If so, we pass it along.
if ($app === false) {
return false;
}

$app->run();
11 changes: 11 additions & 0 deletions 3.4/mariadb/server/apache-vhost.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<VirtualHost *:80>
DocumentRoot /var/www/html/public
DirectoryIndex index.php

<Directory /var/www/html/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
FallbackResource /index.php
</Directory>
</VirtualHost>
3 changes: 3 additions & 0 deletions 3.4/mariadb/server/php-config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 1024M
17 changes: 17 additions & 0 deletions 3.4/mariadb/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
./vendor/bin/nut database:update;
mkdir -p ./app/cache;
mkdir -p ./app/config;
mkdir -p ./app/database;
mkdir -p ./public/extensions;
mkdir -p ./public/extensions/var;
mkdir -p ./public/files;
mkdir -p ./extensions;
chmod -R 0777 ./app;
chmod -R 0777 ./public/extensions;
chmod 0777 ./public/files;


chmod -R 0777 ./extensions;
rm -f /var/run/apache2/apache2.pid
exec apache2-foreground

0 comments on commit 2008ccf

Please sign in to comment.