Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
312 views
in Technique[技术] by (71.8m points)

javascript - Docker compose doesn't connect to POSTGRESQL cloud URL , only changes data locally on Postgres Image

I'm using the following Docker-compose.yaml file :

version: "3"
services:
  myApp:
    container_name: employeeApp
    build:
      context: ./emp
      dockerfile: ./Dockerfile
    ports:
      - "4444:4444"  

  # PostgreSQL
  postgres_svc:
    container_name: PSQL
    image: postgres
    environment:
      POSTGRES_USER: postgres_user
      POSTGRES_PASSWORD: postgres_pass
      POSTGRES_DB: EMP_DB
      POSTGRES_HOST: postgres://postgres_user:[email protected]:5432/EMP_DB
    ports:
      - "5432:5432"

However when I make my SQL calls from inside the employeeApp container , the commands are happening locally , and NOT in the cloud URL postgres://postgres:[email protected]:5432/EMP_DB.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...