# Dedicated, DISPOSABLE Oracle Database Free for the Sql driver's Oracle live gate # (OracleReadTests). # # ── SAFETY ───────────────────────────────────────────────────────────────────── # This stack owns its OWN container, `otopcua-sql-oracle`, on host port 11521 — deliberately not # the default 1521, so it can never be confused with a real Oracle listener on the rig. `restart: # "no"` so a killed container stays down rather than respawning. # # ── DEPLOY (docker runs on the shared Linux host, 10.100.0.35) ────────────────── # # from a Windows VM: # lmxopcua-fix sync sql-oracle # rsync this dir → /opt/otopcua-sql-oracle/ # lmxopcua-fix up sql-oracle # single-service stack (+ one-shot seed), no profile arg # # # from macOS (there is no lmxopcua-fix there — drive the host over SSH): # rsync -av tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Sql.IntegrationTests/Docker/oracle/ \ # dohertj2@10.100.0.35:/opt/otopcua-sql-oracle/ # ssh dohertj2@10.100.0.35 'cd /opt/otopcua-sql-oracle && SQL_ORACLE_PASSWORD=... docker compose up -d' # # ⚠️ FIRST START TAKES MINUTES, not seconds — the image creates the database on first boot. The # healthcheck's start_period reflects that; the seed one-shot simply waits for it. # # ── RUN THE GATE ─────────────────────────────────────────────────────────────── # export SQL_ORACLE_ENDPOINT=10.100.0.35:11521 # export SQL_ORACLE_USER=otopcua # optional; this is the default # export SQL_ORACLE_PASSWORD=... # the same value this compose was brought up with # export SQL_ORACLE_SERVICE=FREEPDB1 # optional; this is the default (the image's PDB) # dotnet test tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Sql.IntegrationTests \ # --filter "FullyQualifiedName~OracleReadTests" # # The one-shot `oracle-seed` service applies seed-oracle.sql once the server is healthy. The # gvenzl images also auto-run scripts mounted at /container-entrypoint-initdb.d, but that path # runs ONLY on the very first boot of an empty data volume — a re-seed after editing the script # would silently not happen. The one-shot service matches the mssql fixture and re-runs every # `docker compose up`, which is why it is used here. name: otopcua-sql-oracle services: oracle: image: gvenzl/oracle-free:23-slim container_name: otopcua-sql-oracle labels: project: lmxopcua restart: "no" environment: # SYS/SYSTEM password. Dev-only sandbox value for a throwaway container. ORACLE_PASSWORD: "${SQL_ORACLE_PASSWORD:-Oracle_dev_pw1}" # The image creates this non-SYS user (and its schema) inside the FREEPDB1 pluggable # database. It is the principal the suite connects as — nothing here ever uses SYS. APP_USER: otopcua APP_USER_PASSWORD: "${SQL_ORACLE_PASSWORD:-Oracle_dev_pw1}" ports: - "11521:1521" healthcheck: # healthcheck.sh ships in the image and reports the database OPEN, not merely the listener up. test: ["CMD", "healthcheck.sh"] interval: 15s timeout: 10s retries: 40 start_period: 180s # One-shot seed: waits for the database to pass its healthcheck, applies seed-oracle.sql, exits. # Reuses the server image purely because it already carries sqlplus. oracle-seed: image: gvenzl/oracle-free:23-slim labels: project: lmxopcua restart: "no" depends_on: oracle: condition: service_healthy environment: APP_USER_PASSWORD: "${SQL_ORACLE_PASSWORD:-Oracle_dev_pw1}" volumes: - ./seed-oracle.sql:/seed.sql:ro entrypoint: - "/bin/bash" - "-c" # -S silent, -L single login attempt (never prompt). The script's WHENEVER SQLERROR EXIT # makes a broken seed fail this service rather than leave a half-seeded schema behind. - "sqlplus -S -L otopcua/\"$${APP_USER_PASSWORD}\"@//oracle:1521/FREEPDB1 @/seed.sql"