Commento run with docker-compose if there is an existing Postgres instance running

Viewed 84

I can run commento with vanilla docker, but get a [ERROR] database_connect.go:31 dbConnect(): cannot talk to postgres, retrying in 10 seconds (4 attempts left): pq: unknown authentication response: 10 when I try to run the .yml configuration file with docker-compose.

I suspect this is because I have a separate Postgres instance running on my server that is linked to my Django models. I'd like to keep the two instances separate if I can so Commento runs on it's own db instance.

How can I do this without shutting down my original Postgres?

Thanks

1 Answers

The reason is outdated dependency in Commento.

If you could use Docker Compose to set up Commento, I think the easiest way is to downgrade PostgreSQL container version.

I have tested commento:v1.8.0 and postgres:11.4 and it works fine. Just add version to these declaration in official yaml file.

docker-compose.yml · master · Commento / Commento · GitLab

version: '3'

services:
  server:
    image: registry.gitlab.com/commento/commento:v1.8.0
    ports:
      - 8080:8080
    environment:
      COMMENTO_ORIGIN: http://commento.example.com:8080
      COMMENTO_PORT: 8080
      COMMENTO_POSTGRES: postgres://postgres:postgres@db:5432/commento?sslmode=disable
    depends_on:
      - db
    networks:
      - db_network
  db:
    image: postgres:11.4
    environment:
      POSTGRES_DB: commento
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    networks:
      - db_network
    volumes:
      - postgres_data_volume:/var/lib/postgresql/data

networks:
  db_network:

volumes:
  postgres_data_volume:

Related