Przeglądaj źródła

Docker follow-up (#1817)

* Docker follow-up

https://github.com/FreshRSS/FreshRSS/pull/1813

* Readme links

cloud.docker.com does not seem to have a public version of the pages
re-add https://hub.docker.com/r/freshrss/freshrss/

* Link to original GitHub readme

* Docker readme MySQL PostgreSQL

https://github.com/FreshRSS/FreshRSS/pull/1817#issuecomment-370195319

* docker exec username
Alexandre Alapetite 8 lat temu
rodzic
commit
29dc711b7b
3 zmienionych plików z 37 dodań i 8 usunięć
  1. 1 1
      Docker/Dockerfile
  2. 35 7
      Docker/README.md
  3. 1 0
      README.md

+ 1 - 1
Docker/Dockerfile

@@ -17,6 +17,6 @@ COPY ./Docker/*.Apache.conf /etc/apache2/conf.d/
 
 
 EXPOSE 80
 EXPOSE 80
 CMD php -f ./cli/prepare.php > /dev/null && \
 CMD php -f ./cli/prepare.php > /dev/null && \
-	chown -R :apache ${FRESHRSS_ROOT} && \
+	chown -R :www-data ${FRESHRSS_ROOT} && \
 	chmod -R g+r ${FRESHRSS_ROOT} && chmod -R g+w ${FRESHRSS_ROOT}/data/ && \
 	chmod -R g+r ${FRESHRSS_ROOT} && chmod -R g+w ${FRESHRSS_ROOT}/data/ && \
 	exec httpd -D FOREGROUND
 	exec httpd -D FOREGROUND

+ 35 - 7
Docker/README.md

@@ -1,5 +1,7 @@
 # Deploy FreshRSS with Docker
 # Deploy FreshRSS with Docker
-* See also https://hub.docker.com/r/freshrss/freshrss/
+* See also:
+	* https://hub.docker.com/r/freshrss/freshrss/
+	* https://cloud.docker.com/app/freshrss/repository/docker/freshrss/freshrss
 
 
 ## Install Docker
 ## Install Docker
 
 
@@ -9,7 +11,7 @@ sh get-docker.sh
 ```
 ```
 
 
 ## Optional: Build Docker image of FreshRSS
 ## Optional: Build Docker image of FreshRSS
-Optional, as a *less recent* [online image](https://hub.docker.com/r/freshrss/freshrss/) can be automatically fetched during the next step (run),
+Optional, as a *less recent* online image can be automatically fetched during the next step (run),
 but online images are not available for as many platforms as if you build yourself.
 but online images are not available for as many platforms as if you build yourself.
 
 
 ```sh
 ```sh
@@ -24,7 +26,7 @@ sudo docker build --tag freshrss/freshrss -f Docker/Dockerfile .
 
 
 ## Run FreshRSS
 ## Run FreshRSS
 
 
-Example exposing FreshRSS on port 8080. You may have to adapt the network parameters to fit your needs.
+Example using SQLite, and exposing FreshRSS on port 8080. You may have to adapt the network parameters to fit your needs.
 
 
 ```sh
 ```sh
 # You can optionally run from the directory containing the FreshRSS source code:
 # You can optionally run from the directory containing the FreshRSS source code:
@@ -39,6 +41,32 @@ sudo docker run -dit --restart unless-stopped --log-opt max-size=10m \
 	--name freshrss freshrss/freshrss
 	--name freshrss freshrss/freshrss
 ```
 ```
 
 
+### Examples with external databases
+
+You may want to use other link methods such as Docker bridges, and use Docker volumes for the data, but here are some simple examples:
+
+#### MySQL
+See https://hub.docker.com/_/mysql/
+
+```sh
+sudo docker run -d -v /path/to/mysql-data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=rootpass -e MYSQL_DATABASE=freshrss -e MYSQL_USER=freshrss -e MYSQL_PASSWORD=pass --name mysql mysql
+sudo docker run -dit --restart unless-stopped --log-opt max-size=10m \
+	-v $(pwd)/data:/var/www/FreshRSS/data \
+	--link mysql -p 8080:80 \
+	--name freshrss freshrss/freshrss
+```
+
+#### PostgreSQL
+See https://hub.docker.com/_/postgres/
+
+```sh
+sudo docker run -d -v /path/to/pgsql-data:/var/lib/postgresql/data -e POSTGRES_DB=freshrss -e POSTGRES_USER=freshrss -e POSTGRES_PASSWORD=pass --name postgres postgres
+sudo docker run -dit --restart unless-stopped --log-opt max-size=10m \
+	-v $(pwd)/data:/var/www/FreshRSS/data \
+	--link postgres -p 8080:80 \
+	--name freshrss freshrss/freshrss
+```
+
 ## Update
 ## Update
 
 
 ```sh
 ```sh
@@ -46,17 +74,17 @@ sudo docker run -dit --restart unless-stopped --log-opt max-size=10m \
 sudo docker pull freshrss/freshrss
 sudo docker pull freshrss/freshrss
 # And then 
 # And then 
 sudo docker stop freshrss
 sudo docker stop freshrss
-docker rename freshrss freshrss_old
+sudo docker rename freshrss freshrss_old
 # See the run section above for the full command
 # See the run section above for the full command
 sudo docker run ...
 sudo docker run ...
 # If everything is working, delete the old container
 # If everything is working, delete the old container
-docker rm freshrss_old
+sudo docker rm freshrss_old
 ```
 ```
 
 
 ## Command line
 ## Command line
 
 
 ```sh
 ```sh
-sudo docker exec -it freshrss php ./cli/list-users.php
+sudo docker exec --user apache -it freshrss php ./cli/list-users.php
 ```
 ```
 
 
 See the [CLI documentation](../cli/) for all the other commands.
 See the [CLI documentation](../cli/) for all the other commands.
@@ -68,7 +96,7 @@ Set a cron job up on your host machine, calling the `actualize_script.php` insid
 Create `/etc/cron.d/FreshRSS` with:
 Create `/etc/cron.d/FreshRSS` with:
 
 
 ```
 ```
-7,37 * * * * root docker exec -it freshrss php ./app/actualize_script.php > /tmp/FreshRSS.log 2>&1
+7,37 * * * * root docker exec --user apache -it freshrss php ./app/actualize_script.php > /tmp/FreshRSS.log 2>&1
 ```
 ```
 
 
 ## Debugging
 ## Debugging

+ 1 - 0
README.md

@@ -1,5 +1,6 @@
 [![Build Status][travis-badge]][travis-link]
 [![Build Status][travis-badge]][travis-link]
 
 
+* Read this document on [github.com/FreshRSS/FreshRSS/](https://github.com/FreshRSS/FreshRSS/blob/master/README.md) to get the correct links and pictures.
 * [Version française](README.fr.md)
 * [Version française](README.fr.md)
 
 
 # FreshRSS
 # FreshRSS