Skip to content

Unable to connect to Postgres with docker-compose #345

Description

@cclloyd

When trying to set up nextcloud it keeps telling me that it can't connect to the database, or that password authentication failed for user 'postgres'. (I can connect via psql so the username/password is correct)

version: '3.5'

services:
    db:
        image: postgres
        restart: always
        ports:
          - "5432:5432"
        volumes:
          - ./db/nextcloud.sql:/docker-entrypoint-initdb.d/nextcloud.sql
          - postgres-data:/var/lib/postgresql/data
    nextcloud:
        image: nextcloud
        ports:
          - 8080:80
        depends_on:
          - db
        volumes:
          - nextcloud:/var/www/html
        restart: always
        environment:
          POSTGRES_DB: 'nextcloud'
          POSTGRES_USER: 'postgres'
          POSTGRES_PASSWORD: 'postgres'
          POSTGRES_HOST: 'db:5432'

volumes:
  nextcloud:
  postgres-data:
  db:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions