From 0cc9436cc06a8cc26dab1590a0ff0489466b4e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 17 Jul 2022 23:58:54 +0200 Subject: [PATCH] Added information about database file mapping to docker installation and use this in example docker-compose.yaml This fixes issue #134 and #127 --- docs/docker/docker-compose.yaml | 6 +++++- docs/docker/docker-install.md | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/docker/docker-compose.yaml b/docs/docker/docker-compose.yaml index 2e17c823..a62121f7 100644 --- a/docs/docker/docker-compose.yaml +++ b/docs/docker/docker-compose.yaml @@ -9,5 +9,9 @@ services: # By default - ./uploads:/var/www/html/uploads - ./public_media:/var/www/html/public/media + - ./db:/var/www/html/var/db restart: unless-stopped - image: jbtronics/part-db1:master \ No newline at end of file + image: jbtronics/part-db1:master + environment: + # Put SQLite database in our mapped folder. You can configure some other kind of database here too. + - DATABASE_URL=sqlite:///%kernel.project_dir%/var/db/app.db \ No newline at end of file diff --git a/docs/docker/docker-install.md b/docs/docker/docker-install.md index d30ba4e6..64fba74f 100644 --- a/docs/docker/docker-install.md +++ b/docs/docker/docker-install.md @@ -19,6 +19,9 @@ The docker image uses a SQLite database and all data (database, uploads and othe ## Direct use of docker image You can use the `jbtronics/part-db1:master` image directly. You have to expose the port 80 to a host port and configure volumes for `/var/www/html/uploads` and `/var/www/html/public/media`. +If you want to use SQLite database (which is default), you have to configure Part-DB to put the database file in a mapped volume via the `DATABASE_URL` environment variable. +For example if you set `DATABASE_URL=sqlite:///%kernel.project_dir%/var/db/app.db` then you will have to map the `/var/www/html/var/db/` folder to the docker container (see docker-compose.yaml for example). + You also have to create the database like described above in step 4. ## Running console commands