Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

258
Views
Can't connect to databases from devcontainer

I'm working on building an environment for an educational setting, but for some reason my dev container isn't able to connect to the databases that are being generated by the docker-compose.yml. See below:

# docker-compose.yml
version: '3.9'

services:
  conda:
    image: continuumio/anaconda3:latest
    build:
      context: ..
      dockerfile: .devcontainer/Dockerfile
    command: sleep infinity
    volumes:
      - ..:/workspace:cached

  mongo:
    image: mongo:latest
    restart: unless-stopped
    volumes:
      - dbs:/data/db

  postgres:
    image: postgres:latest
    restart: unless-stopped
    volumes:
      - dbs:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: postgres
  
volumes:
  dbs:

When I attempt to connect to the PostgreSQL database using SQLTools on port 5432 on localhost, I get the following:

[1642491269885] ERROR (ls): Connecting error: {"code":-32001,"data":{"driver":"PostgreSQL","driverOptions":{}},"name":"Error"}
    ns: "conn-manager"
[1642491269886] ERROR (ext): ERROR: Error opening connection connect ECONNREFUSED 127.0.0.1:5432, {"code":-32001,"data":{"driver":"PostgreSQL","driverOptions":{}}}
    ns: "error-handler"

As a possibly important aside, I am also noticing that the PostgreSQL instance is constantly restarting. Here is what the docker container set looks like:

enter image description here

However, I should note that I can't connect to the mongodb instance either, using the Mongo for VS Code extension.

Let me know how I can make this work!

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!