From 29de8cc453daf40ad23a2833c82302e5deda14f6 Mon Sep 17 00:00:00 2001 From: schuer Date: Sat, 5 Oct 2024 23:44:00 +0200 Subject: [PATCH] docs: add recipe for custom setup with pre-installed addons --- recipes/README.md | 3 +- recipes/custom-setup-with-addons/Dockerfile | 6 ++++ recipes/custom-setup-with-addons/README.md | 7 ++++ .../custom-setup-with-addons/custom-setup.sh | 18 ++++++++++ .../docker-compose.yml | 33 +++++++++++++++++++ 5 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 recipes/custom-setup-with-addons/Dockerfile create mode 100644 recipes/custom-setup-with-addons/README.md create mode 100644 recipes/custom-setup-with-addons/custom-setup.sh create mode 100644 recipes/custom-setup-with-addons/docker-compose.yml diff --git a/recipes/README.md b/recipes/README.md index 788ca56..0f84ac2 100644 --- a/recipes/README.md +++ b/recipes/README.md @@ -1,6 +1,7 @@ # 🧁 Recipes: REDAXO with Docker -- [REDAXO + PHP 8](https://github.com/FriendsOfREDAXO/docker-redaxo/tree/main/recipes/php8) 🚀 +- [REDAXO + custom setup with pre-installed addons](https://github.com/FriendsOfREDAXO/docker-redaxo/tree/main/recipes/custom-setup-with-addons) 📦 +- [REDAXO + PHP 8](https://github.com/FriendsOfREDAXO/docker-redaxo/tree/main/recipes/php8) - [REDAXO + Apache + MySQL](https://github.com/FriendsOfREDAXO/docker-redaxo/tree/main/recipes/apache-mysql) - [REDAXO + Apache + MariaDB](https://github.com/FriendsOfREDAXO/docker-redaxo/tree/main/recipes/apache-mariadb) - [REDAXO (FPM) + NGINX + MariaDB](https://github.com/FriendsOfREDAXO/docker-redaxo/tree/main/recipes/nginx-mariadb) diff --git a/recipes/custom-setup-with-addons/Dockerfile b/recipes/custom-setup-with-addons/Dockerfile new file mode 100644 index 0000000..f098824 --- /dev/null +++ b/recipes/custom-setup-with-addons/Dockerfile @@ -0,0 +1,6 @@ +FROM friendsofredaxo/redaxo:5 + +# copy custom setup script +# will be executed within the REDAXO container once the REDAXO setup was finished +COPY custom-setup.sh /usr/local/bin/ +RUN chmod +x /usr/local/bin/custom-setup.sh diff --git a/recipes/custom-setup-with-addons/README.md b/recipes/custom-setup-with-addons/README.md new file mode 100644 index 0000000..d760300 --- /dev/null +++ b/recipes/custom-setup-with-addons/README.md @@ -0,0 +1,7 @@ +# REDAXO + custom setup with pre-installed addons + +This setup demonstrates how to start up a REDAXO container with several addons already pre-installed. It makes use of a `custom-setup.sh` script that runs after REDAXO has been installed. + +1. Run `docker-compose build` to build from the contained Dockerfile and custom-setup script. +2. Run `docker-compose up -d` to fire up Docker. +3. Access REDAXO in your browser at [http://localhost/redaxo](http://localhost/redaxo): Login screen should be awesome neon, and some other addons are already installed. diff --git a/recipes/custom-setup-with-addons/custom-setup.sh b/recipes/custom-setup-with-addons/custom-setup.sh new file mode 100644 index 0000000..7c54703 --- /dev/null +++ b/recipes/custom-setup-with-addons/custom-setup.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -euo pipefail + +cd /var/www/html + +php redaxo/bin/console install:download developer 3.9.2 +php redaxo/bin/console package:install developer + +php redaxo/bin/console install:download yform 4.2.1 +php redaxo/bin/console package:install yform + +php redaxo/bin/console install:download yrewrite 2.10.0 +php redaxo/bin/console package:install yrewrite + +php redaxo/bin/console install:download login_neon 1.0.0 +php redaxo/bin/console package:install login_neon + +chown -R www-data:www-data ./ diff --git a/recipes/custom-setup-with-addons/docker-compose.yml b/recipes/custom-setup-with-addons/docker-compose.yml new file mode 100644 index 0000000..864ac22 --- /dev/null +++ b/recipes/custom-setup-with-addons/docker-compose.yml @@ -0,0 +1,33 @@ +services: + + redaxo: + build: . + ports: + - 80:80 + volumes: + - ./html:/var/www/html:cached + depends_on: + - db + environment: + REDAXO_SERVER: http://localhost + REDAXO_SERVERNAME: "REDAXO" + REDAXO_ERROR_EMAIL: mail@you.example + REDAXO_LANG: de_de + REDAXO_TIMEZONE: Europe/London + REDAXO_DB_HOST: db + REDAXO_DB_NAME: redaxo + REDAXO_DB_LOGIN: redaxo + REDAXO_DB_PASSWORD: redaxo + REDAXO_DB_CHARSET: utf8mb4 + REDAXO_ADMIN_USER: admin + REDAXO_ADMIN_PASSWORD: admin123 + + db: + image: mysql:8 + volumes: + - ./db:/var/lib/mysql:cached + environment: + MYSQL_DATABASE: redaxo + MYSQL_USER: redaxo + MYSQL_PASSWORD: redaxo + MYSQL_RANDOM_ROOT_PASSWORD: 'yes'