I keep getting the following error on the `npx lerna run migration:run` command which connects to postgres.
{ Error: connect ECONNREFUSED 127.0.0.1:5432
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1097:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 5432 }
My bitbucket pipeline looks like this
image: node:10.15.3
options:
max-time: 20
definitions:
services:
docker:
memory: 2000
postgres:
image: postgres
restart: always
environment:
POSTGRES_DB: 'db'
POSTGRES_USER: 'postgres'
POSTGRES_PASSWORD: 'test'
steps:
- step: &install-deps
name: Prepare node_modules
caches: *app-caches
script:
- npx lerna bootstrap --hoist
- npm i -g ts-node typescript
- npx lerna run migration:run
- npx lerna run seed
pipelines:
default:
- step: *install-deps
services:
- postgres