]> BookStack Code Mirror - bookstack/commitdiff
Dev Docker: Fixed missing gd jpeg handling, forced migrations
authorDan Brown <redacted>
Sun, 1 Dec 2024 16:02:21 +0000 (16:02 +0000)
committerDan Brown <redacted>
Sun, 1 Dec 2024 16:10:05 +0000 (16:10 +0000)
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.

dev/docker/Dockerfile
dev/docker/entrypoint.app.sh
dev/docs/development.md

index 9f283c75544b6ef70efeb400a7f3910369a1aadc..edab90ca1c5e9ad1ad126dcb217700844eb230ee 100644 (file)
@@ -6,15 +6,18 @@ RUN apt-get update && \
         git \
         zip \
         unzip \
-        libpng-dev \
+        libfreetype-dev \
+        libjpeg62-turbo-dev \
         libldap2-dev \
+        libpng-dev \
         libzip-dev \
         wait-for-it && \
     rm -rf /var/lib/apt/lists/*
 
 # Install PHP extensions
 RUN docker-php-ext-configure ldap --with-libdir="lib/$(gcc -dumpmachine)" && \
-    docker-php-ext-install pdo_mysql gd ldap zip && \
+    docker-php-ext-configure gd --with-freetype --with-jpeg && \
+    docker-php-ext-install -j$(nproc) pdo_mysql gd ldap zip && \
     pecl install xdebug && \
     docker-php-ext-enable xdebug
 
index e91d34a713377a7e579a6594000c01fb5c98ba57..b09edda8863e8eb02f8b695c168138719be23ee2 100755 (executable)
@@ -9,7 +9,7 @@ if [[ -n "$1" ]]; then
 else
     composer install
     wait-for-it db:3306 -t 45
-    php artisan migrate --database=mysql
-    chown -R www-data:www-data storage
+    php artisan migrate --database=mysql --force
+    chown -R www-data storage public/uploads bootstrap/cache
     exec apache2-foreground
 fi
index 3c7a6e9d299f4b76095538111231c263fc5eb617..0324140f8bd4b87ef92c133721bda75126f032a7 100644 (file)
@@ -82,7 +82,7 @@ If all the conditions are met, you can proceed with the following steps:
 
 1. **Copy `.env.example` to `.env`**, change `APP_KEY` to a random 32 char string and set `APP_ENV` to `local`.
 2. Make sure **port 8080 is unused** *or else* change `DEV_PORT` to a free port on your host.
-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.
+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.
 4. **Run `docker-compose up`** and wait until the image is built and all database migrations have been done.
 5. You can now login with `admin@admin.com` and `password` as password on `localhost:8080` (or another port if specified).
 
Morty Proxy This is a proxified and sanitized view of the page, visit original site.