Skip to content

Possiblity to autoinstall in Docker Compose#3353

Merged
Alkarex merged 3 commits intoFreshRSS:masterfrom
Alkarex:docker_auto_install
Jan 11, 2021
Merged

Possiblity to autoinstall in Docker Compose#3353
Alkarex merged 3 commits intoFreshRSS:masterfrom
Alkarex:docker_auto_install

Conversation

@Alkarex
Copy link
Copy Markdown
Member

@Alkarex Alkarex commented Jan 9, 2021

#fix #3349

It is simply calling our existing CLI: do-install.php and create-user.php
https://github.com/FreshRSS/FreshRSS/tree/master/cli
(So all the API options are available)

FreshRSS will typically be ready a few seconds before the database, so introduce a tolerance when the database is not available / up (yet) by trying a few times to connect. Also useful to avoid service interruption when DB service is restarted.

Example:

version: "3"

services:
  freshrss-db:
    image: postgres:12-alpine
    container_name: freshrss-db
    hostname: freshrss-db
    restart: unless-stopped
    volumes:
      - db:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: freshrss
      POSTGRES_PASSWORD: freshrss
      POSTGRES_DB: freshrss

  freshrss-app:
    image: freshrss/freshrss
    container_name: freshrss-app
    hostname: freshrss-app
    restart: unless-stopped
    ports:
      - "8080:80"
    depends_on:
      - freshrss-db
    volumes:
      - data:/var/www/FreshRSS/data
      - extensions:/var/www/FreshRSS/extensions
    environment:
      CRON_MIN: '*/20'
      FRESHRSS_ENV: development
      FRESHRSS_INSTALL: |-
        --api_enabled
        --base_url https://rss.example.net
        --db-base freshrss
        --db-host freshrss-db
        --db-password freshrss
        --db-type pgsql
        --db-user freshrss
        --default_user admin
        --language en
      FRESHRSS_USER: |-
        --api_password freshrss
        --email [email protected]
        --language en
        --password freshrss
        --user admin
      TZ: Europe/Paris

volumes:
  db:
  data:
  extensions:

#fix FreshRSS#3349

It is simply calling our existing CLI: do-install.php and
create-user.php
https://github.com/FreshRSS/FreshRSS/tree/master/cli

FreshRSS will typically be ready a few seconds before the database, so
introduce a tolerance when the database is not available / up (yet) by
trying a few times to connect. Also useful to avoid service interruption
when DB service is restarted.

Example:

```yml
freshrss-app:
    image: freshrss/freshrss
    container_name:
freshrss-app
    hostname: freshrss-app
    restart: unless-stopped

ports:
      - "8080:80"
    depends_on:
      - freshrss-db

volumes:
      - data:/var/www/FreshRSS/data
      -
extensions:/var/www/FreshRSS/extensions
    environment:
      CRON_MIN:
'*/20'
      FRESHRSS_ENV: development
      FRESHRSS_INSTALL: |-

--api_enabled
        --base_url https://rss.example.net

--db-base freshrss
        --db-host freshrss-db
        --db-password
freshrss
        --db-type pgsql
        --db-user freshrss

--default_user admin
        --language en
      FRESHRSS_USER: |-

--api_password freshrss
        --email [email protected]

--language en
        --password freshrss
        --user admin
      TZ:
Europe/Paris
```
Copy link
Copy Markdown
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it should be harmless here, it's probably better to avoid the shellcheck warning you're channeling with useless cat & probably also quotation marks around the $() subshell. (And also double check if it has something else to say besides what stands out to me at a glance.)

@Alkarex
Copy link
Copy Markdown
Member Author

Alkarex commented Jan 9, 2021

I think I will look again at cli/do-install.php and cli/create-user.php to (optionally) be able to call them multiple times and update the configurations accordingly, but probably in another PR.

@Alkarex
Copy link
Copy Markdown
Member Author

Alkarex commented Jan 9, 2021

@Frenzie Please give an example, I am not sure what you mean precisely :-)

@Alkarex Alkarex mentioned this pull request Jan 9, 2021
3 tasks
@Alkarex Alkarex force-pushed the docker_auto_install branch from 0f5b318 to f5024c5 Compare January 10, 2021 10:38
@Alkarex Alkarex merged commit 8dfe209 into FreshRSS:master Jan 11, 2021
@Alkarex Alkarex deleted the docker_auto_install branch January 11, 2021 21:36
@Alkarex Alkarex linked an issue Jan 22, 2021 that may be closed by this pull request
@Alkarex Alkarex linked an issue Jan 22, 2021 that may be closed by this pull request
@Alkarex Alkarex added the Docker 🐋 Everything related to Docker label Jan 22, 2021
@Alkarex Alkarex mentioned this pull request Feb 27, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docker 🐋 Everything related to Docker

Projects

None yet

2 participants