Skip to content

Instantly share code, notes, and snippets.

@amitaibu
Last active January 5, 2021 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amitaibu/1ca9c2a31fdfa2d8c536b82a7e0ba654 to your computer and use it in GitHub Desktop.
Save amitaibu/1ca9c2a31fdfa2d8c536b82a7e0ba654 to your computer and use it in GitHub Desktop.
connection.dialect = org.hibernate.dialect.PostgreSQLDialect
connection.driver_class = org.postgresql.Driver
# "db" maps to service name defined in Docker Compose
# "dhis2" maps to POSTGRES_DB defined in Docker Compose
connection.url = jdbc:postgresql://db/dhis2
# maps to POSTGRES_USER environment variable in Docker Compose.
connection.username = dhis
# maps to POSTGRES_PASSWORD environment variable in Docker Compose.
connection.password = dhis
version: '3'
services:
db:
volumes:
- ./db:/docker-entrypoint-initdb.d/
image: mdillon/postgis:10
command: postgres -c max_locks_per_transaction=100
restart: always
environment:
POSTGRES_USER: dhis
POSTGRES_DB: dhis2
POSTGRES_PASSWORD: dhis
webapp:
image: dhis2/core:2.32.5
volumes:
- ./dhis.conf:/DHIS2_home/dhis.conf
ports:
- "8085:8080"
@jaboto
Copy link

jaboto commented Jun 25, 2020

Yo probably want to include an environment in your webapp so it waits for the DB to be prepopulated. And also a dependency.

        environment:
            - WAIT_FOR_DB_CONTAINER=db:5432 -t 0
        depends_on:
            - db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment