0

Unable to connect with Cloud SQL using cloudsql-proxy from tenderflow-server. The tenderflow-server container (Nodejs server) fails to connect with cloudsql-proxy. But both of the containers running fine.

Here is the docker-compose.yaml

version: "3"
services:
  cloudsql-proxy:
    container_name: cloudsql-proxy
    image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.4.0 
    command: tenderflow-392115:asia-south1:tenderflowsql
    ports:
      - 3306:3306
    environment:
      - GOOGLE_APPLICATION_CREDENTIALS=/config/key.json
    volumes:
      - ./key.json:/config/key.json:ro
    restart: always

  tenderflow-server:
    build:
      context: .
    image: tenderflow
    ports:
      - 5000:5000
    depends_on:
      - cloudsql-proxy
    env_file: .env
    command: sh -c "npm install && npm run start"
    restart: on-failure

enter image description here

enter image description here

Rwitesh Bera
  • 389
  • 2
  • 3
  • 9

0 Answers0