From 8dd8dd73de3f26f37b5854ee2f172a9fd0bdd92d Mon Sep 17 00:00:00 2001 From: Jeroen Geusebroek Date: Sun, 3 Jan 2021 14:11:50 +0100 Subject: [PATCH] Add docker-compose example. Thanks Daniel Jongepier. --- README.md | 11 +++++++++++ docker-compose.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 docker-compose.yml diff --git a/README.md b/README.md index ab9eab7..72d3092 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ An image running [ubuntu/20.04](https://hub.docker.com/_/ubuntu/) Linux and [Spo You need a seperate MySQL / MariaDB server. This can of course be a (linked) docker container but also a dedicated database server. +If you would like to use docker-compose, a short guide can be found [below](#docker-compose). Thanks to [Daniel Jongepier](https://github.com/djongepier). ## Usage @@ -65,6 +66,16 @@ To enable automatic retrieval from within the container, use the `SPOTWEB_CRON_R The container will try to auto-update the database when a newer version is released. +### Docker compose + +An example `docker-compose.yml` is included. Create your base directory and edit the environment variables to suit your needs. After the initial run (`docker-compose up -d`) you will need to remove the `/spotweb/dbsettings.inc.php` because otherwise the install process won't proceed. Don't worry, your settings won't be lost. + +After you deleted the file, point your browser to your install (ie. [http://localhost:81/install.php](http://localhost:81/install.php)) and follow the installation procedure. + +It might give you an error saying it can't write the settings to file. You can ignore this. + +When this all is fininished, restart spotweb using `docker-compose restart`. You should now have a working spotweb installation. (please note the `/spotweb/dbsettings.inc.php` file will be automatically recreated during the restart). + ### Environment variables | Variable | Function | | --- | --- | diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e834c7a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,40 @@ +version: "2.1" +services: + spotweb: + image: jgeusebroek/spotweb + container_name: spotweb + restart: unless-stopped + environment: + - PUID=1001 + - GUID=1001 + - TZ=Europe/Amsterdam + - SPOTWEB_DB_TYPE=pdo_mysql + - SPOTWEB_DB_HOST=spotweb_db + - SPOTWEB_DB_PORT=3306 + - SPOTWEB_DB_NAME=spotweb + - SPOTWEB_DB_USER=spotweb + - SPOTWEB_DB_PASS=spotweb + - "SPOTWEB_CRON_RETRIEVE=* */2 * * *" + depends_on: + - spotwebdb + ports: + - 81:80 + volumes: + - /spotweb:/config + + spotweb_db: + image: linuxserver/mariadb + container_name: spotwebdb + restart: unless-stopped + environment: + - PUID=1001 + - PGID=1001 + - MYSQL_ROOT_PASSWORD=spotweb + - TZ=Europe/Amsterdam + - MYSQL_DATABASE=spotweb + - MYSQL_USER=spotweb + - MYSQL_PASSWORD=spotweb + volumes: + - /mariadb:/config + ports: + - 3306:3306