How to access postgres-docker container other docker container without ip address? I want to store data in postgres by using myweb. in jar given host like localhost:5432/db..
Here my compose file:
version: "3" services: myweb: build: ./myweb container_name: app ports: - "8080:8080" - "9090:9090" networks: - front-tier - back-tier depends_on: - "postgresdb" postgresdb: build: ./mydb image: ppk:postgres9.5 volumes: - dbdata:/var/lib/postgresql ports: - "5432:5432" networks: - back-tier volumes: dbdata: {} networks: front-tier: back-tier:
network_mode: host
to your docker compose service? In this way, containers can share local ethernet iface. – Alejandro Galera