From 519fbcf581616db83696dc8242d9c7de55a598d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Tue, 27 Oct 2020 21:21:19 -0700 Subject: [PATCH] Add few Docker Compose examples --- contrib/README.md | 4 +++ contrib/docker-compose/Caddyfile | 2 ++ contrib/docker-compose/README.md | 13 ++++++++ contrib/docker-compose/basic.yml | 25 ++++++++++++++++ contrib/docker-compose/caddy.yml | 38 +++++++++++++++++++++++ contrib/docker-compose/traefik.yml | 48 ++++++++++++++++++++++++++++++ 6 files changed, 130 insertions(+) create mode 100644 contrib/README.md create mode 100644 contrib/docker-compose/Caddyfile create mode 100644 contrib/docker-compose/README.md create mode 100644 contrib/docker-compose/basic.yml create mode 100644 contrib/docker-compose/caddy.yml create mode 100644 contrib/docker-compose/traefik.yml diff --git a/contrib/README.md b/contrib/README.md new file mode 100644 index 00000000..a40be36e --- /dev/null +++ b/contrib/README.md @@ -0,0 +1,4 @@ +The contrib directory contains various useful things contributed by the community. + +Community contributions are not officially supported by the maintainers. +There is no guarantee whatsoever that anything in this folder works. diff --git a/contrib/docker-compose/Caddyfile b/contrib/docker-compose/Caddyfile new file mode 100644 index 00000000..6754535f --- /dev/null +++ b/contrib/docker-compose/Caddyfile @@ -0,0 +1,2 @@ +miniflux.example.org +reverse_proxy miniflux:8080 diff --git a/contrib/docker-compose/README.md b/contrib/docker-compose/README.md new file mode 100644 index 00000000..300d381e --- /dev/null +++ b/contrib/docker-compose/README.md @@ -0,0 +1,13 @@ +Docker-Compose Examples +======================= + +Here are few Docker Compose examples: + +- `basic.yml`: Basic example +- `caddy.yml`: Use Caddy as reverse-proxy with automatic HTTPS +- `traefik.yml`: Use Traefik as reverse-proxy with automatic HTTPS + +```bash +docker-compose -f basic.yml up -d db +docker-compose -f basic.yml up +``` diff --git a/contrib/docker-compose/basic.yml b/contrib/docker-compose/basic.yml new file mode 100644 index 00000000..acc8b0af --- /dev/null +++ b/contrib/docker-compose/basic.yml @@ -0,0 +1,25 @@ +version: '3.3' +services: + miniflux: + image: miniflux/miniflux:latest + container_name: miniflux + ports: + - "80:8080" + depends_on: + - db + environment: + - DATABASE_URL=postgres://miniflux:secret@db/miniflux?sslmode=disable + - RUN_MIGRATIONS=1 + - CREATE_ADMIN=1 + - ADMIN_USERNAME=admin + - ADMIN_PASSWORD=test123 + db: + image: postgres:latest + container_name: postgres + environment: + - POSTGRES_USER=miniflux + - POSTGRES_PASSWORD=secret + volumes: + - miniflux-db:/var/lib/postgresql/data +volumes: + miniflux-db: \ No newline at end of file diff --git a/contrib/docker-compose/caddy.yml b/contrib/docker-compose/caddy.yml new file mode 100644 index 00000000..c9f16596 --- /dev/null +++ b/contrib/docker-compose/caddy.yml @@ -0,0 +1,38 @@ +version: '3.3' +services: + caddy: + image: caddy:2 + container_name: caddy + depends_on: + - miniflux + ports: + - "80:80" + - "443:443" + volumes: + - $PWD/Caddyfile:/etc/caddy/Caddyfile + - caddy_data:/data + - caddy_config:/config + miniflux: + image: miniflux/miniflux:latest + container_name: miniflux + depends_on: + - db + environment: + - DATABASE_URL=postgres://miniflux:secret@db/miniflux?sslmode=disable + - RUN_MIGRATIONS=1 + - CREATE_ADMIN=1 + - ADMIN_USERNAME=admin + - ADMIN_PASSWORD=test123 + - BASE_URL=https://miniflux.example.org + db: + image: postgres:latest + container_name: postgres + environment: + - POSTGRES_USER=miniflux + - POSTGRES_PASSWORD=secret + volumes: + - miniflux-db:/var/lib/postgresql/data +volumes: + miniflux-db: + caddy_data: + caddy_config: diff --git a/contrib/docker-compose/traefik.yml b/contrib/docker-compose/traefik.yml new file mode 100644 index 00000000..a06a519e --- /dev/null +++ b/contrib/docker-compose/traefik.yml @@ -0,0 +1,48 @@ +version: '3.3' +services: + traefik: + image: "traefik:v2.3" + container_name: traefik + command: + - "--providers.docker=true" + - "--providers.docker.exposedbydefault=false" + - "--entrypoints.websecure.address=:443" + - "--certificatesresolvers.myresolver.acme.tlschallenge=true" + - "--certificatesresolvers.myresolver.acme.email=postmaster@example.com" + - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json" + depends_on: + - miniflux + ports: + - "443:443" + volumes: + - "./letsencrypt:/letsencrypt" + - "/var/run/docker.sock:/var/run/docker.sock:ro" + miniflux: + image: miniflux/miniflux:latest + container_name: miniflux + depends_on: + - db + expose: + - "8080" + environment: + - DATABASE_URL=postgres://miniflux:secret@db/miniflux?sslmode=disable + - RUN_MIGRATIONS=1 + - CREATE_ADMIN=1 + - ADMIN_USERNAME=admin + - ADMIN_PASSWORD=test123 + - BASE_URL=https://miniflux.example.org + labels: + - "traefik.enable=true" + - "traefik.http.routers.miniflux.rule=Host(`miniflux.example.org`)" + - "traefik.http.routers.miniflux.entrypoints=websecure" + - "traefik.http.routers.miniflux.tls.certresolver=myresolver" + db: + image: postgres:latest + container_name: postgres + environment: + - POSTGRES_USER=miniflux + - POSTGRES_PASSWORD=secret + volumes: + - miniflux-db:/var/lib/postgresql/data +volumes: + miniflux-db: