Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database configuration error when deploy with docker compose #2547

Closed
fakegit opened this issue Sep 30, 2019 · 5 comments
Closed

Database configuration error when deploy with docker compose #2547

fakegit opened this issue Sep 30, 2019 · 5 comments
Labels
Docker Everything related to Docker Documentation 📚
Milestone

Comments

@fakegit
Copy link

fakegit commented Sep 30, 2019

Follow https://github.com/FreshRSS/FreshRSS/blob/master/Docker/README.md

My docker compose config file:

version: '2.3'

services:
  freshrss-postgresql:
    image: postgres:latest
    restart: unless-stopped
    volumes:
    - 'pgsql-data:/var/lib/postgresql/data'
    environment:
    - POSTGRES_USER=freshrss
    - POSTGRES_PASSWORD=xxxxxx
    - POSTGRES_DB=freshrss

  freshrss:
    image: freshrss/freshrss:latest
    restart: unless-stopped
    ports:
      - "1201:80"
    depends_on:
      - freshrss-postgresql
    networks:
      - freshrss-network
    volumes:
      - 'freshrss-data:/var/www/FreshRSS/data'
    environment:
      - CRON_MIN=*/20

networks:
  freshrss-network:
    external: true

volumes:
  pgsql-data:
    external: true
  freshrss-data:
    external: true

everything works fine until website install step 3: Database configuration

I tried "Host" with localhost, 127.0.0.1, 172.21.0.2(freshrss-postgresql container's network ip), freshrss-postgresql, even my server ip, none of them work.

  • localhost:

Blast! Verify your database information. : SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? could not connect to server: Cannot assign requested address Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?

  • 127.0.0.1:

Blast! Verify your database information. : SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?

  • 172.21.0.2:

Blast! Verify your database information. : SQLSTATE[08006] [7] timeout expired

  • freshrss-postgresql:

Blast! Verify your database information. : SQLSTATE[08006] [7] could not translate host name "freshrss-postgresql" to address: Name or service not known

  • server ip:

Blast! Verify your database information. : SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host "my server ip" and accepting TCP/IP connections on port 5432?

@Alkarex
Copy link
Member

Alkarex commented Sep 30, 2019

Hello @fakegit
This is because your PostgreSQL database is not on the same network than FreshRSS. Please try the docker-compose file below with an additional line to fix your problem:

version: '2.3'

services:
  freshrss-postgresql:
    image: postgres:latest
    restart: unless-stopped
    networks:
      - freshrss-network
    volumes:
      - 'pgsql-data:/var/lib/postgresql/data'
    environment:
      - POSTGRES_USER=freshrss
      - POSTGRES_PASSWORD=xxxxxx
      - POSTGRES_DB=freshrss

  freshrss:
    image: freshrss/freshrss:latest
    restart: unless-stopped
    ports:
      - "1201:80"
    depends_on:
      - freshrss-postgresql
    networks:
      - freshrss-network
    volumes:
      - 'freshrss-data:/var/www/FreshRSS/data'
    environment:
      - CRON_MIN=*/20

networks:
  freshrss-network:
    external: true

volumes:
  pgsql-data:
    external: true
  freshrss-data:
    external: true

@Alkarex Alkarex added this to the 1.15.0 milestone Sep 30, 2019
@Alkarex
Copy link
Member

Alkarex commented Sep 30, 2019

P.S.: If you have time to send a PR to make our documentation/example better, that would be nice :-)

@Alkarex
Copy link
Member

Alkarex commented Sep 30, 2019

P.P.S: We should update the example to use version 3 of docker-compose
https://docs.docker.com/compose/compose-file/compose-versioning/#version-3

@fakegit
Copy link
Author

fakegit commented Sep 30, 2019

@Alkarex thanks, it works now by putting postgres in the same network, which is missed in the https://github.com/FreshRSS/FreshRSS/blob/dev/Docker/docker-compose.yml

I'm not familiar with pr workflow, and my english is not good, however, i will give a try.

Thanks again.

Alkarex added a commit to Alkarex/FreshRSS that referenced this issue Oct 5, 2019
@Alkarex
Copy link
Member

Alkarex commented Oct 5, 2019

Done in #2553

@Alkarex Alkarex closed this as completed Oct 5, 2019
Alkarex added a commit that referenced this issue Oct 5, 2019
javerous pushed a commit to javerous/FreshRSS that referenced this issue Jan 20, 2020
@Alkarex Alkarex added the Docker Everything related to Docker label Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docker Everything related to Docker Documentation 📚
Projects
None yet
Development

No branches or pull requests

2 participants