Containers are awesome, not only for stateless things

UPDATE 250627: it’s hard to update blog posts consistently, I have since moved the compose files for Oracle Database 23ai Free and ORDS/APEX to my GitHub. Please use these files instead. If you find any issues, please file one so they can be addressed.

Recently I posted about jump-starting your MLE/JavaScript and APEX environment, using containers. Back in the day when I hit the publish button, the following versions were current:

Fast forward to today, and the situation has changed. But since I’m using a compose file to create my local playground environment, that’s not a big deal. All I need to do is update the version numbers in the compose file, like so:

# THIS IS NOT A PRODUCTION SETUP - LAB USE ONLY!
# Note that secrets require the use of podman/podman-compose
# there _might_ be Docker swarm/stack support but I didn't run any tests to ensure compatibility

services:
    dbfree:
        image: gvenzl/oracle-free:23.7
        ports:
            - 1521:1521
        environment:
            - ORACLE_PASSWORD_FILE=/run/secrets/oracle-passwd
            - APP_USER=martin
            - APP_USER_PASSWORD_FILE=/run/secrets/app-passwd
        volumes:
            - oradata-vol:/opt/oracle/oradata
        networks:
            - backend
        healthcheck:
            test: [ "CMD", "healthcheck.sh" ]
            interval: 10s
            timeout: 5s
            retries: 10
            start_period: 5s
        secrets:
            - oracle-passwd
            - app-passwd

    ords:
        depends_on:
            dbfree:
                condition: service_healthy
        image: container-registry.oracle.com/database/ords-developer:24.4.0
        networks:
            - backend
        volumes:
            - ords-config-vol:/etc/ords/config
            - ./setup:/opt/oracle/variables
        ports:
            - 8181:8181

volumes:
    oradata-vol:
    ords-config-vol:

secrets:
    oracle-passwd:
        external: true
    app-passwd:
        external: true

networks:
    backend:

> Please remember that this compose file is only ever intended for playing with a local development and playground environment featuring Oracle Database 23ai Free and APEX.

Remember to create the secrets if you haven’t got them already:

podman secret create oracle-passwd /path/to/file/containing/the/password
podman secret create app-passwd /path/to/file/containing/the/password

You also need to create ./setup/conn_string.txt containing the following connection string:

echo "CONN_STRING=sys/password@$(basename `pwd`)_dbfree_1:1521/freepdb1" > setup/conn_string.txt

If you followed closely and compared the previous post with this one, you will have noticed that I swapped the database image for Gerald Venzl’s image. I required a pre-defined application user for a demo and found this image the easiest to use. Please head to Oracle’s container registry for the official, Oracle-supplied image. Also, note that this is a Podman compose file. You might have to change it slightly to work with Docker.

Now that the versions have been updated, all I need to do is podman-compose up -d to get a new, updated playground environment using the latest and greatest software. No messing around with Java versions, package dependencies, or anything like that. The base OS remains in a very clean state, which is exactly what I like.

Have fun!