Added ldap and moved compose for docker-dev setup

- Also tweaked readme a little to fit this is with more recent changes.
This commit is contained in:
Dan Brown 2019-08-26 22:01:10 +01:00
parent aea5319256
commit 21f09a5920
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
3 changed files with 19 additions and 14 deletions

View File

@ -4,8 +4,9 @@ ENV APACHE_DOCUMENT_ROOT /app/public
WORKDIR /app WORKDIR /app
RUN apt-get update -y \ RUN apt-get update -y \
&& apt-get install -y libtidy-dev libpng-dev libxml++2.6-dev wait-for-it \ && apt-get install -y libtidy-dev libpng-dev libldap2-dev libxml++2.6-dev wait-for-it \
&& docker-php-ext-install pdo pdo_mysql tidy dom xml mbstring gd \ && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu \
&& docker-php-ext-install pdo pdo_mysql tidy dom xml mbstring gd ldap \
&& a2enmod rewrite \ && a2enmod rewrite \
&& sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \ && 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 \ && sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf \

View File

@ -1,5 +1,5 @@
# This is a Docker Compose configuration # This is a Docker Compose configuration
# intended for development purposes # intended for development purposes only
version: '3' version: '3'
@ -19,7 +19,7 @@ services:
- db:/var/lib/mysql - db:/var/lib/mysql
app: app:
build: build:
context: .. context: .
dockerfile: ./dev/docker/Dockerfile dockerfile: ./dev/docker/Dockerfile
environment: environment:
DB_CONNECTION: mysql DB_CONNECTION: mysql
@ -31,11 +31,11 @@ services:
ports: ports:
- ${DEV_PORT:-8080}:80 - ${DEV_PORT:-8080}:80
volumes: volumes:
- ../:/app - ./:/app
entrypoint: /app/dev/docker/entrypoint.app.sh entrypoint: /app/dev/docker/entrypoint.app.sh
node: node:
image: node:alpine image: node:alpine
working_dir: /app working_dir: /app
volumes: volumes:
- ../:/app - ./:/app
entrypoint: /app/dev/docker/entrypoint.node.sh entrypoint: /app/dev/docker/entrypoint.node.sh

View File

@ -79,7 +79,7 @@ Once done you can run `php vendor/bin/phpunit` in the application root directory
PHP code within BookStack is generally to [PSR-2](http://www.php-fig.org/psr/psr-2/) standards. From the BookStack root folder you can run `./vendor/bin/phpcs` to check code is formatted correctly and `./vendor/bin/phpcbf` to auto-fix non-PSR-2 code. PHP code within BookStack is generally to [PSR-2](http://www.php-fig.org/psr/psr-2/) standards. From the BookStack root folder you can run `./vendor/bin/phpcs` to check code is formatted correctly and `./vendor/bin/phpcbf` to auto-fix non-PSR-2 code.
### Getting started with Development using Docker ### 🐋 Development using Docker
This repository ships with a Docker Compose configuration intended for development purposes. It'll build a PHP image with all needed extensions installed and start up a MySQL server and a Node image watching the UI assets. This repository ships with a Docker Compose configuration intended for development purposes. It'll build a PHP image with all needed extensions installed and start up a MySQL server and a Node image watching the UI assets.
@ -87,17 +87,21 @@ To get started, make sure you meet the following requirements:
- Docker and Docker Compose are installed - Docker and Docker Compose are installed
- Your user is part of the `docker` group - Your user is part of the `docker` group
- Composer is installed
If all the conditions are met, you can proceed with the following steps: If all the conditions are met, you can proceed with the following steps:
1. Install Composer dependencies with **`docker-compose run app composer install`** (first time can take a while because the image has to be built) 1. Install PHP/Composer dependencies with **`docker-compose run app composer install`** (first time can take a while because the image has to be built).
2. **Copy `.env.example` to `.env`** and change `APP_KEY` to a random 32 char string 2. **Copy `.env.example` to `.env`** and change `APP_KEY` to a random 32 char string.
3. Make sure **port 8080 is unused** *or else* change `DEV_PORT` to a free port on your host 3. Make sure **port 8080 is unused** *or else* change `DEV_PORT` to a free port on your host.
4. **Run `chgrp -R docker storage`**. The development container will chown the `storage` directory to the `www-data` user inside the container so BookStack can write to it. You need to change the group to your host's `docker` group here to not lose access to the `storage` directory 4. **Run `chgrp -R docker storage`**. The development container will chown the `storage` directory to the `www-data` user inside the container so BookStack can write to it. You need to change the group to your host's `docker` group here to not lose access to the `storage` directory.
5. **Run `docker-compose up`** and wait until all database migrations have been done 5. **Run `docker-compose up`** and wait until all database migrations have been done.
6. You can now login with `admin@admin.com` and `password` as password on `localhost:8080` (or another port if specified) 6. You can now login with `admin@admin.com` and `password` as password on `localhost:8080` (or another port if specified).
If needed, You'll be able to run any artisan commands via docker-compose like so:
```shell script
docker-compose run app php artisan list
```
## 🌎 Translations ## 🌎 Translations