main | PrismaClientInitializationError: Can't reach database server at `localhost:5432`
main |
main | Please make sure your database server is running at `localhost:5432`.
main | at t (/app/prisma/generated/client/runtime/library.js:112:2488)
main | at async Proxy.onModuleInit (/app/src/prisma.service.ts:8:5)
main | /app/prisma/generated/client/runtime/library.js:112
main | You may have to run ${$e("prisma generate")} for your changes to take effect.
services:
main:
container_name: main
build:
context: .
env_file:
- .development.env
volumes:
- .:/app
- /app/node_modules
ports:
- 5000:5000
- 9229:9229
command: npm run dev
depends_on:
- postgres
restart: always
postgres:
container_name: postgres
image: postgres:12
env_file:
- .development.env
environment:
PG_DATA: /var/lib/postgresql/data
ports:
- 5432:5432
volumes:
- pgdata:/var/lib/postgresql/data
restart: always
volumes:
pgdata:
FROM node:latest
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
COPY ./dist ./dist
CMD ["npm", "run", "dev"]
я запускал:
docker-compose build
docker-compose up
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/dbName?schema=public"