Oracle Cloud

Oracle Cloud Deployment Guide

Deploy SelfHostedDB on Oracle Cloud Infrastructure

This guide covers deploying SelfHostedDB on Oracle Cloud using Container Instances or OKE.


Option 1: Oracle Container Instances

Best for: Simple deployments on Oracle Cloud

Steps

  1. Create Container Instance

    • Navigate to Oracle Cloud Console → Container Instances
    • Create new instance with:
      • Image: your-registry/selfhosteddb:latest
      • Shape: VM.Standard.E2.1 (1 OCPU, 8GB RAM)
      • Networking: Public subnet with ingress rule for port 3001
  2. Configure Environment Variables

    • Use Oracle Cloud Secrets Manager or environment variables
    • Set: DATABASE_URL, AUTH_USER, AUTH_PASS, NODE_ENV, PORT
  3. Database Options:

    • Oracle Database with PostgreSQL compatibility: Use connection string
    • Oracle Autonomous Database: Configure connection
    • External PostgreSQL: Point to existing instance

Option 2: Oracle Kubernetes Engine (OKE)

Best for: Scalable, production deployments

Steps

  1. Create OKE Cluster

    • Use Oracle Cloud Console or Terraform
    • Minimum: 2 nodes, VM.Standard.E2.1 shape
  2. Deploy Application

    • Use Kubernetes manifests (same as AWS EKS - see Production Guide)
    • Store secrets in Oracle Vault
    • Configure ingress controller for HTTPS

Secrets Management

# Store secrets in Oracle Vault
oci vault secret create \
  --compartment-id <compartment-id> \
  --vault-id <vault-id> \
  --secret-name database-url \
  --secret-content '{"content": "postgres://..."}'

Monitoring

Oracle Cloud Monitoring

  • Metrics: CPU, memory, network usage
  • Alarms: Set up alerting policies
  • Dashboards: Create custom dashboards

Logging

  • Application Logs: Use Oracle Cloud Logging
  • Container Logs: View in Container Instances console

Security Best Practices

  • Use Oracle Vault for all secrets
  • Enable VCN (Virtual Cloud Network) for network isolation
  • Use security lists to restrict access
  • Enable database encryption at rest
  • Use SSL/TLS for all connections

Cost Optimization

  • Container Instances: Use smaller shapes for development
  • OKE: Use flexible node shapes with auto-scaling
  • Database: Use Always Free tier for development

Related Documentation


Last Updated: 2025-01-27