小编Ric*_*ang的帖子

出现错误:在 Github Actions 中连接 ECONNREFUSED 127.0.0.1:5432

我正在尝试在 github actions 中使用 docker 连接到 Postgres。这是我的 github 操作文件:

    name: Carbon Link backend server CI

on:
  push:
    branches: [ 'develop', 'PC-3-setup-github-actions-on-pr-request' ]
  pull_request:
    branches: [ 'develop', 'PC-3-setup-github-actions-on-pr-request' ]
jobs:
  # label of the container job 
  postgres-test:
    runs-on: ubuntu-latest
    container: node:latest

    services:
      postgres:
        image: postgres:latest
        # `POSTGRES_HOST` is `postgres`
        env:
          POSTGRES_DB: carbonlink
          POSTGRES_PASSWORD: password
          # optional (defaults to `5432`)
          POSTGRES_PORT: 5432
          # optional (defaults to `postgres`)
          POSTGRES_USER: postgres
        ports:
          - 5432:5432
        # set health checks to wait until postgres has started …
Run Code Online (Sandbox Code Playgroud)

postgresql node.js sequelize.js docker github-actions

6
推荐指数
1
解决办法
4086
查看次数