Skip to content

Commit 227c5e1

Browse files
committed
Dev Docker: Fixed missing gd jpeg handling, forced migrations
Migrations run without force could fail startup in certain environment conditions (when testing production env). Also updated paths permission handling to update more needed locations.
1 parent fbeb2e2 commit 227c5e1

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

dev/docker/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@ RUN apt-get update && \
66
git \
77
zip \
88
unzip \
9-
libpng-dev \
9+
libfreetype-dev \
10+
libjpeg62-turbo-dev \
1011
libldap2-dev \
12+
libpng-dev \
1113
libzip-dev \
1214
wait-for-it && \
1315
rm -rf /var/lib/apt/lists/*
1416

1517
# Install PHP extensions
1618
RUN docker-php-ext-configure ldap --with-libdir="lib/$(gcc -dumpmachine)" && \
17-
docker-php-ext-install pdo_mysql gd ldap zip && \
19+
docker-php-ext-configure gd --with-freetype --with-jpeg && \
20+
docker-php-ext-install -j$(nproc) pdo_mysql gd ldap zip && \
1821
pecl install xdebug && \
1922
docker-php-ext-enable xdebug
2023

dev/docker/entrypoint.app.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if [[ -n "$1" ]]; then
99
else
1010
composer install
1111
wait-for-it db:3306 -t 45
12-
php artisan migrate --database=mysql
13-
chown -R www-data:www-data storage
12+
php artisan migrate --database=mysql --force
13+
chown -R www-data storage public/uploads bootstrap/cache
1414
exec apache2-foreground
1515
fi

dev/docs/development.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ If all the conditions are met, you can proceed with the following steps:
8282

8383
1. **Copy `.env.example` to `.env`**, change `APP_KEY` to a random 32 char string and set `APP_ENV` to `local`.
8484
2. Make sure **port 8080 is unused** *or else* change `DEV_PORT` to a free port on your host.
85-
3. **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.
85+
3. **Run `chgrp -R docker storage`**. The development container will chown the `storage`, `public/uploads` and `bootstrap/cache` directories 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.
8686
4. **Run `docker-compose up`** and wait until the image is built and all database migrations have been done.
8787
5. You can now login with `[email protected]` and `password` as password on `localhost:8080` (or another port if specified).
8888

0 commit comments

Comments
 (0)