I keep getting the following error on the `npx lerna run migration:run` command which connects to postgres.
<span> at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1097:14)</span><span> errno: 'ECONNREFUSED',</span><span> code: 'ECONNREFUSED',</span><span> syscall: 'connect',</span><span> address: '127.0.0.1',</span><span> port: 5432 }</span><span>{ Error: connect ECONNREFUSED 127.0.0.1:5432</span>
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