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 does not work!
I'm using Spring Boot for the container API and the following message appears in the terminal:
Connection to lx-plug-tax-db: 5430 refused. Check that the hostname and port are correct and that 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 am I doing wrong?