Skip to content

Docker-compose example #320

Open
Open
@latot

Description

@latot

Hi all, I don't know why, but run postgis with docker run is so easy, but with docker compose so hard u.u

This works great:

docker run -d -p 5432:5432 -e POSTGRES_USER=user -e POSTGRES_PASSWORD=password -e POSTGRES_DB=db postgis/postgis

But the next one fails!

  postgis:
    image: postgis/postgis
    volumes:
      - ./postgis/etc:/etc
    environment:
      # If you need to create multiple database you can add coma separated databases eg gis,data
      - POSTGRES_DB=db
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    ports:
      - "5432:5432"
    restart: on-failure

with:

docker logs ca84d57458df
find: ‘postgres’ is not the name of a known user
find: ‘postgres’ is not the name of a known user
find: ‘postgres’ is not the name of a known user
find: ‘postgres’ is not the name of a known user
find: ‘postgres’ is not the name of a known user
find: ‘postgres’ is not the name of a known user
find: ‘postgres’ is not the name of a known user

I really don't get why one works and the other not, maybe there is a tricky thing about docker-compose.

Well, there is the chance, this problem is in postgres image and not postgis, but lets start :)

Thx!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions