aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <aledeg@users.noreply.github.com> 2020-06-10 23:16:14 +0200
committerGravatar GitHub <noreply@github.com> 2020-06-10 23:16:14 +0200
commit0910cf34c735d6b59b495e0b0dfff08d21fce7ac (patch)
tree32b0cec8b6d77180a67e1e673b8fbc6915686b0c
parent7f76c8e553a498f8235c5fa79622b6d79b86765b (diff)
Add support for extensions in Docker environment (#3042)
By default, the container starts without extensions. But if for some reasons, you need to add them without copying or moving some code, you can embed them while starting the container. The syntax is: ``` make start extensions="/full/path/to/extension/1 /full/path/to/extension/2" ```
-rw-r--r--Makefile2
-rw-r--r--docs/en/developers/03_Backend/05_Extensions.md7
-rw-r--r--docs/fr/developers/03_Backend/05_Extensions.md7
3 files changed, 16 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 6e77de8a9..566fd3c10 100644
--- a/Makefile
+++ b/Makefile
@@ -38,9 +38,11 @@ build: ## Build a Docker image
.PHONY: start
start: ## Start the development environment (use Docker)
+ $(foreach extension,$(extensions),$(eval volumes=$(volumes) --volume $(extension):/var/www/FreshRSS/extensions/$(notdir $(extension)):z))
docker run \
--rm \
--volume $(shell pwd):/var/www/FreshRSS:z \
+ $(volumes) \
--publish $(PORT):80 \
--env FRESHRSS_ENV=development \
--name freshrss-dev \
diff --git a/docs/en/developers/03_Backend/05_Extensions.md b/docs/en/developers/03_Backend/05_Extensions.md
index efcd6e4e2..5ba90bc8c 100644
--- a/docs/en/developers/03_Backend/05_Extensions.md
+++ b/docs/en/developers/03_Backend/05_Extensions.md
@@ -216,6 +216,13 @@ Here we are! We've talked about the most useful features of Minz and how to run
An extension allows you to easily add functionality to FreshRSS without having to touch the core of the project directly.
+### Make it work in Docker
+
+When working on an extension, it's easier to see it working directly in its environment. With Docker, you can leverage the use of the ```volume``` option when starting the container. Hopefully, you can use it without Docker-related knowledge by using the Makefile rule:
+```
+make start extensions="/full/path/to/extension/1 /full/path/to/extension/2"
+```
+
### Basic files and folders
The first thing to note is that **all** extensions **must** be located in the `extensions` directory, at the base of the FreshRSS tree.
diff --git a/docs/fr/developers/03_Backend/05_Extensions.md b/docs/fr/developers/03_Backend/05_Extensions.md
index 1f7687b47..95cccfe7f 100644
--- a/docs/fr/developers/03_Backend/05_Extensions.md
+++ b/docs/fr/developers/03_Backend/05_Extensions.md
@@ -374,6 +374,13 @@ temps d'aborder les extensions en elles-même.
Une extension permet donc d'ajouter des fonctionnalités facilement à
FreshRSS sans avoir à toucher au cœur du projet directement.
+### Travailler dans Docker
+
+Quand on travaille sur une extension, c'est toujours plus facile de la travailler directement dans son environnement. Avec Docker, on peut exploiter l'option ```volume``` quand on démarre le conteneur. Heureusement, on peut l'utiliser sans avoir de connaissances particulières de Docker en utilisant la règle du Makefile :
+```
+make start extensions="/chemin/complet/de/l/extension/1 /chemin/complet/de/l/extension/2"
+```
+
### Les fichiers et répertoires de base
La première chose à noter est que **toutes** les extensions **doivent** se