1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-11-01 14:51:10 +03:00

Add docker development environment

This commit is contained in:
Timo Schwarzer
2019-06-23 13:16:45 +02:00
parent 4de432b50d
commit 9357620d55
10 changed files with 705 additions and 1 deletions

15
docker/dev/Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
FROM php:7.3-apache
ENV APACHE_DOCUMENT_ROOT /app/public
WORKDIR /app
RUN apt-get update -y \
&& apt-get install -y libtidy-dev libpng-dev libxml++2.6-dev wait-for-it \
&& docker-php-ext-install pdo pdo_mysql tidy dom xml mbstring gd \
&& a2enmod rewrite \
&& sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \
&& sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf \
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php composer-setup.php \
&& mv composer.phar /usr/bin/composer \
&& php -r "unlink('composer-setup.php');"

12
docker/dev/entrypoint.app.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
set -e
if [[ "$1" == "composer" ]]; then
exec "$@"
else
wait-for-it db:3306 -t 45
php artisan migrate --database=mysql_docker_dev
chown -R www-data:www-data storage
exec apache2-foreground
fi

8
docker/dev/entrypoint.node.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
set -e
npm install
npm rebuild node-sass
exec npm run watch