Tested on my machine via fresh dev instance with tests passing.
May need old users to drop their old volume data.
'mysql_testing' => [
'driver' => 'mysql',
'url' => env('TEST_DATABASE_URL'),
- 'host' => $mysql_host,
+ 'host' => '127.0.0.1',
'database' => 'bookstack-test',
'username' => env('MYSQL_USER', 'bookstack-test'),
'password' => env('MYSQL_PASSWORD', 'bookstack-test'),
ENV APACHE_DOCUMENT_ROOT /app/public
WORKDIR /app
+# Install additional dependacnies and configure apache
RUN apt-get update -y \
&& apt-get install -y git zip unzip libpng-dev libldap2-dev wait-for-it \
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu \
&& docker-php-ext-install pdo_mysql gd ldap \
&& 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');" \
+ && sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
+
+# Install composer
+RUN 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');"
+
+# Use the default production configuration and update it as required
+RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
+ && sed -i 's/memory_limit = 128M/memory_limit = 512M/g' "$PHP_INI_DIR/php.ini"
\ No newline at end of file
composer install
wait-for-it db:3306 -t 45
php artisan migrate --database=mysql
- php artisan migrate --database=mysql_testing
chown -R www-data:www-data storage
exec apache2-foreground
fi
context: .
dockerfile: ./dev/docker/Dockerfile
environment:
+ APP_URL: http://localhost:${DEV_PORT:-8080}
DB_CONNECTION: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: bookstack-dev
DB_USERNAME: bookstack-test
DB_PASSWORD: bookstack-test
+ TEST_DATABASE_URL: mysql://bookstack-test:bookstack-test@db/bookstack-test
MAIL_DRIVER: smtp
MAIL_HOST: mailhog
MAIL_PORT: 1025
If needed, You'll be able to run any artisan commands via docker-compose like so:
-```shell script
+```bash
docker-compose run app php artisan list
```
#### Running tests
-After starting the general development Docker, seed the testing database:
- ```shell script
-# this is to be done only once
+After starting the general development Docker, migrate & seed the testing database:
+
+ ```bash
+# This only needs to be done once
+docker-compose run app php artisan migrate --database=mysql_testing
docker-compose run app php artisan db:seed --class=DummyContentSeeder --database=mysql_testing
```
-Once the database has been seeded, you can run the tests by:
- ```shell script
+Once the database has been migrated & seeded, you can run the tests like so:
+
+ ```bash
docker-compose run app php vendor/bin/phpunit
```
+
## 🌎 Translations
Translations for text within BookStack is managed through the [BookStack project on Crowdin](https://crowdin.com/project/bookstack). Some strings have colon-prefixed variables in such as `:userName`. Leave these values as they are as they will be replaced at run-time. Crowdin is the preferred way to provide translations, otherwise the raw translations files can be found within the `resources/lang` path.