Skip to content

Docker Compose Oracle Database #3075

Description

@davidedisa

Hello,

I have the following Docker Compose service for deploying an Oracle Database:

services:
oracle-db:
container_name: oracle-db-ee
image: database:19.3.0-ee-ext
restart: unless-stopped
environment:
ORACLE_PWD: "XXXXX"
volumes:
- /u01/oracle-database:/opt/oracle/oradata
ports:
- "1521:1521"
networks:
- librared
healthcheck:
test: ["CMD-SHELL", "sqlplus -s sys/${ORACLE_PWD}@localhost:1521/ORCLPDB1 as sysdba <<< 'SELECT 1 FROM DUAL;' | grep -q 1"]
interval: 30s
timeout: 10s
retries: 100
start_period: 120s

I would like to deploy other services that depend on the database being fully initialized, so I tried:

depends_on:
oracle-db:
condition: service_healthy

However, the database healthcheck reports as healthy even while the database is still being installed/initialized.

What would be the correct way to ensure that dependent services only start once the database is fully ready?

Regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions