Skip to content

Commit b7e15be

Browse files
committed
Update docker-compose and .env.example
Error: Database URL: Environment variables loaded from .env Prisma schema loaded from prisma/postgresql-schema.prisma Datasource "db": PostgreSQL database "evolution", schema "public" at "localhost:5432" Error: P1001: Can't reach database server at localhost:5432 Fix: Update `docker-compose.yaml` and `.env.example` files to configure PostgreSQL service and connection URI. * **docker-compose.yaml** - Add `listen_addresses=*` command to the `postgres` service. - Add environment variables: `POSTGRES_USER=user`, `POSTGRES_PASSWORD=pass`, `POSTGRES_DB=evolution`, `POSTGRES_HOST_AUTH_METHOD=trust`. * **.env.example** - Update `DATABASE_CONNECTION_URI` to `postgresql://user:pass@postgres:5432/evolution?schema=public`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/EvolutionAPI/evolution-api?shareId=XXXX-XXXX-XXXX-XXXX).
1 parent 1665654 commit b7e15be

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ DEL_INSTANCE=false
2626

2727
# Provider: postgresql | mysql
2828
DATABASE_PROVIDER=postgresql
29-
DATABASE_CONNECTION_URI='postgresql://user:pass@localhost:5432/evolution?schema=public'
29+
DATABASE_CONNECTION_URI='postgresql://user:pass@postgres:5432/evolution?schema=public'
3030
# Client name for the database connection
3131
# It is used to separate an API installation from another that uses the same database.
3232
DATABASE_CONNECTION_CLIENT_NAME=evolution_exchange

docker-compose.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@ services:
3434
image: postgres:15
3535
networks:
3636
- evolution-net
37-
command: ["postgres", "-c", "max_connections=1000"]
37+
command: ["postgres", "-c", "max_connections=1000", "-c", "listen_addresses=*"]
3838
restart: always
3939
ports:
4040
- 5432:5432
4141
environment:
42-
- POSTGRES_PASSWORD=PASSWORD
42+
- POSTGRES_USER=user
43+
- POSTGRES_PASSWORD=pass
44+
- POSTGRES_DB=evolution
45+
- POSTGRES_HOST_AUTH_METHOD=trust
4346
volumes:
4447
- postgres_data:/var/lib/postgresql/data
4548
expose:

0 commit comments

Comments
 (0)