ガイド一覧

Connecting databases

Create PostgreSQL, MySQL, MariaDB, MongoDB or Redis and connect your app.

  1. 1Create

    bash
    oc db create postgres --name db
    oc db create redis --name cache
  2. 2Connect with references

    Inside a project the service name is the host. Use references instead of copying values; they follow password changes.

    bash
    oc variables set DATABASE_URL='${{db.DATABASE_URL}}' REDIS_URL='${{cache.REDIS_URL}}'
  3. 3Connect from your computer

    Turn on Public access in the Database tab to connect from pgAdmin, Workbench, Compass or Redis Insight at <service>-<project>.app.onecloud.im:<port>. To keep it private, use the VPN (Network → VPN).

  4. 4Allow-list for external databases

    Register every outbound IP shown in the Network tab.