1
I’m using Docker Compose to climb my containers in the Docker, the problem I’m having is making the link between a container and another. My Docker Compose:
version: '3'
services:
DB:
image: postgres:9.6.0
ports:
- "5430:5432"
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=mydatabase
volumes:
- /srv/docker/postgresql:/var/lib/postgresql
container_name: lx-gulp-db
API:
image: lx-gulp:api
ports:
- "8200:8080"
container_name: lx-gulp-api
depends_on:
- DB
links:
- "DB:lx-gulp-db"
WEB:
image: lx-gulp:web
ports:
- "8008:8080"
container_name: lx-gulp-web
links:
- "API:lx-gulp-api"
Docker-Compose up DB is OK!
Docker-Compose up API doesn’t work!
I’m using Spring Boot to the container API and the following message appears on the terminal:
Connection to lx-plug-tributacao-db:5430 refused. Check that the hostname and port are correct and that the postmaster is Accepting TCP/IP Connections.
My application.yml:
spring:
profiles: production
datasource:
url: jdbc:postgresql://lx-gulp-db:5430/mydatabase
username: postgres
password: postgres
driver-class-name: org.postgresql.Driver
test-on-borrow: true
validation-query: SELECT 1 FROM dual
jpa:
hibernate:
ddl-auto: validate
jackson:
serialization:
WRITE_DATES_AS_TIMESTAMPS: false
date-format: com.fasterxml.jackson.databind.util.ISO8601DateFormat
server:
port: 8080
flyway:
schemas: public
Warning: I’m using Ubuntu as S.O.
What I’m doing wrong?
This is the Stack Overflow in Portuguese, try to ask questions in English in the Stack Overflow
– Bsalvo