docker icon indicating copy to clipboard operation
docker copied to clipboard

build fails with Can't reach database server at `localhost`:`5432`

Open drwb opened this issue 2 years ago • 0 comments

Every time I sit down to try and get this running I seem to take a step backwards.

A new pull, from scratch, on a cleaned-out docker.

DOCKER_BUILDKIT=0 docker compose build calcom

Fails with

@calcom/prisma:build: Prisma schema loaded from schema.prisma
@calcom/prisma:build: Datasource "db": PostgreSQL database "calcom", schema "public" at "localhost:5450"
@calcom/prisma:build: 
@calcom/prisma:build: Error: P1001: Can't reach database server at `localhost`:`5450`
@calcom/prisma:build: 
@calcom/prisma:build: Please make sure your database server is running at `localhost`:`5450`.
@calcom/prisma:build: error Command failed with exit code 1.
@calcom/prisma:build: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@calcom/prisma:build: error Command failed with exit code 1.
@calcom/prisma:build: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

The docker compose up -d database command created:

90638b40ac21   postgres                    "docker-entrypoint.s…"   18 minutes ago   Up 18 minutes            5432/tcp   database

Port 5432 is confirmed in docker container inspect 90638b40ac21

"Ports": {
                "5432/tcp": null
            },

But even if I change the DATABASE_URL in .env to :5432 it fails with the same error.

drwb avatar Sep 10 '22 16:09 drwb