-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
240 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
database: | ||
driver: mysql | ||
host: mysql | ||
username: %APP_USER% | ||
password: %APP_PASSWORD% | ||
databasename: %APP_USER% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "rossriley/docker-bolt", | ||
"require": { | ||
"bolt/bolt": "^3.5" | ||
}, | ||
"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" | ||
], | ||
"post-create-project-cmd": [ | ||
"Bolt\\Composer\\ScriptHandler::configureProject", | ||
"Bolt\\Composer\\ScriptHandler::installThemesAndFiles", | ||
"nut extensions:setup" | ||
] | ||
}, | ||
"extra": { | ||
"bolt-web-dir": "./public" | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
./vendor/bin/nut database:update -n; | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM php:7.2-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 libsqlite3-dev sqlite3 curl git | ||
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \ | ||
docker-php-ext-install gd && \ | ||
docker-php-ext-install pdo_sqlite && \ | ||
docker-php-ext-install exif && \ | ||
docker-php-ext-install zip && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
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/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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
extensions: | ||
composer: | ||
minimum-stability: dev |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "rossriley/docker-bolt", | ||
"require": { | ||
"bolt/bolt": "^3.5" | ||
}, | ||
"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" | ||
], | ||
"post-create-project-cmd": [ | ||
"Bolt\\Composer\\ScriptHandler::configureProject", | ||
"Bolt\\Composer\\ScriptHandler::installThemesAndFiles", | ||
"nut extensions:setup" | ||
] | ||
}, | ||
"extra": { | ||
"bolt-web-dir": "./public" | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<VirtualHost *:80> | ||
DocumentRoot /var/www/html/public | ||
DirectoryIndex index.php | ||
|
||
<Directory /var/www/html/public/> | ||
Options Indexes FollowSymLinks MultiViews | ||
Require all granted | ||
FallbackResource /index.php | ||
</Directory> | ||
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
./vendor/bin/nut database:update -n; | ||
mkdir -p ./app/cache; | ||
mkdir -p ./app/config; | ||
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; | ||
IFS="," | ||
set -- $BOLT_EXT | ||
for element in $@ | ||
do | ||
echo "Installing extension $element"; | ||
eval "./vendor/bin/nut extensions:install $element"; | ||
done | ||
|
||
if [ -n "$BOLT_THEME" ] | ||
then | ||
echo "Installing theme $BOLT_THEME"; | ||
eval "./vendor/bin/nut config:set theme demo"; | ||
eval "cp -prf extensions/vendor/$BOLT_THEME public/theme/demo" | ||
eval "cp -prf extensions/vendor/$BOLT_THEME public/theme/`basename $BOLT_THEME`" | ||
eval "cp -prf vendor/bolt/bolt/files/* public/files/" | ||
else | ||
echo -e "BOLT_THEME not set\n" | ||
fi | ||
|
||
if [ -n "$BOLT_TITLE" ] | ||
then | ||
eval "./vendor/bin/nut config:set sitename '$BOLT_TITLE'"; | ||
fi | ||
|
||
chmod -R 0777 ./extensions; | ||
rm -f /var/run/apache2/apache2.pid | ||
exec apache2-foreground |