Przeglądaj źródła

Add a docker compose example. (#1882)

* Add a docker compose example.

Using postgresql and with traefik specific labels.

* Added docker-compose specific documentation.

* Move docker-compose section at the end of the README.md.
Upils 8 lat temu
rodzic
commit
0ccda74571
2 zmienionych plików z 52 dodań i 1 usunięć
  1. 16 1
      Docker/README.md
  2. 36 0
      Docker/docker-compose.yml

+ 16 - 1
Docker/README.md

@@ -75,7 +75,7 @@ sudo docker run -d --restart unless-stopped --log-opt max-size=10m \
 ```sh
 # Rebuild an image (see build section above) or get a new online version:
 sudo docker pull freshrss/freshrss
-# And then 
+# And then
 sudo docker stop freshrss
 sudo docker rename freshrss freshrss_old
 # See the run section above for the full command
@@ -155,3 +155,18 @@ ls /var/www/FreshRSS/
 Use a reverse proxy on your host server, such as [Træfik](https://traefik.io/)
 or [nginx](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/),
 with HTTPS, for instance using [Let’s Encrypt](https://letsencrypt.org/).
+
+### Example with [docker-compose](https://docs.docker.com/compose/)
+
+A `docker-compose.yml` file is given as an example, using PostgreSQL. In order to use it, you have to adapt:
+- In the `postgresql` service:
+	* the `volumes` section;
+	* the `POSTGRES_PASSWORD` in the `environment` section;
+- In the `freshrss` service:
+	* the `volumes` section;
+	* options under the `labels` section are specific to [Træfik](https://traefik.io/), a reverse proxy. If you are not using it, feel free to delete this section. If you are using it, adapt accordingly to your config, especially the `traefik.frontend.rule` option.
+
+You can then launch the stack (postgres + freshrss) with:
+```sh
+docker-compose up -d
+```

+ 36 - 0
Docker/docker-compose.yml

@@ -0,0 +1,36 @@
+version: '2.3'
+
+services:
+  postgresql:
+    image: postgres:latest
+    restart: unless-stopped
+    volumes:
+    - '/path/to/pgsql-data:/var/lib/postgresql/data:Z'
+    environment:
+    - POSTGRES_USER=freshrss
+    - POSTGRES_PASSWORD=password
+    - POSTGRES_DB=freshrss
+
+  freshrss:
+    image: freshrss/freshrss:latest
+    restart: unless-stopped
+    depends_on:
+      - postgresql
+    networks:
+      - web
+      - default
+    volumes:
+      - '/your/local/directory/data:/var/www/FreshRSS/data:Z'
+    labels:
+      - "traefik.backend=freshrss"
+      - "traefik.docker.network=web"
+      - "traefik.frontend.rule=Host:rss.example.com"
+      - "traefik.enable=true"
+      - "traefik.default.protocol=http"
+      - "traefik.frontend.entryPoints=http,https"
+      - "traefik.port=80"
+
+networks:
+  web:
+    external: true
+