jira and postgres docker-compose
05:54 18 Jun 2020

I have the next code which is a "docker compose" yml file and for some reason I can't find a way to make Jira connect to Postgresql

version: '3'

services:
  jira:
    container_name: jira
    depends_on:
      - postgresql
    image: atlassian/jira-software:8.5.4
    networks:
      - jiranet
    volumes:
      - jiradata:/var/atlassian/jira
    ports:
      - '8080:8080'
    environment:
      - 'ATL_JDBC_URL=localhost:5432'
      - 'JIRA_DB_PASSWORD=admin'
      - 'SETENV_JVM_MINIMUM_MEMORY=2048m'
      - 'SETENV_JVM_MAXIMUM_MEMORY=4096m'
      - 'JIRA_PROXY_NAME='
      - 'JIRA_PROXY_PORT='
      - 'JIRA_PROXY_SCHEME='

  postgresql:
    container_name: postgres
    image: postgres:9.6
    expose:
      - "5432"
    networks:
      - jiranet
    volumes:
      - postgresqldata:/var/lib/postgresql/data
    environment:
      - 'POSTGRES_USER=jiradbuser'
      # CHANGE THE PASSWORD!
      - 'POSTGRES_PASSWORD=admin'
      - 'POSTGRES_DB=jiradb'
      - 'POSTGRES_ENCODING=UNICODE'
      - 'POSTGRES_COLLATE=C'
      - 'POSTGRES_COLLATE_TYPE=C'

volumes:
  jiradata:
    external: false
  postgresqldata:
    external: false

networks:
  jiranet:
    driver: bridge

I looked at the logs using

docker-compose --verbose up -d

and everything seems fine and both containers are up and running, but Jira won't connect to DB.

Your help on the matter will be much appreciated

postgresql docker docker-compose jira