retrievercommunications / docker-jasperserver

Docker image for the community edition of JasperReports® Server.
https://hub.docker.com/r/retriever/jasperserver/
MIT License
46 stars 50 forks source link

Jasperserver exited with code 124 #9

Closed elceka closed 6 years ago

elceka commented 6 years ago

Hi, i have this docker compose file:

version: '2'
services:
  postgres:
    image: postgres:latest
    ports:
      - "54323:5432"
    working_dir: /var/lib/postgresql/data
    volumes:
      - ./docker/postgresql/data:/var/lib/postgresql/data
    restart: always
    environment:
      - POSTGRES_DB=testy
      - POSTGRES_USER=testy_db_user
      - POSTGRES_PASSWORD=Testy#987
  jasperserver:
    image: retriever/jasperserver
    restart: always
    ports:
     - "8080:8080"
    environment:
     - DB_TYPE=postgres
     - DB_HOST=postgres
     - DB_PORT=54323
     - DB_USER=testy_db_user
     - DB_PASSWORD=Testy#987
    volumes:
     - ./docker/jasperserver:/jasperserver-import
    depends_on:
     - postgres
    links:
      - postgres

But, if i try run project from docker compose file by command docker-compose up then i get on the console this:

postgres_1      | LOG:  database system was shut down at 2017-10-12 15:04:36 UTC
postgres_1      | LOG:  MultiXact member wraparound protections are now enabled
jasperserver_1  | wait-for-it.sh: waiting 30 seconds for postgres:54323
postgres_1      | LOG:  database system is ready to accept connections
postgres_1      | LOG:  autovacuum launcher started
jasperserver_1  | wait-for-it.sh: timeout occurred after waiting 30 seconds for postgres:54323
testy_jasperserver_1 exited with code 124

Configuration of the postgres servise is correct, i can connect to the database. Please, where i have a problem?

grange74 commented 6 years ago

I'm guessing it is because of the DB_PORT=54323 environment of the jasperserver container in your docker-compose file.

When using links, the jasperserver container will have access to the container port 5432 but not the host port 54323. I would recommend changing to DB_PORT=5432.

elceka commented 6 years ago

Thank you, fixed.