|
| 1 | +# Open Container Engine - Quick Start Guide |
| 2 | + |
| 3 | +## 🚀 How to Run |
| 4 | + |
| 5 | +### Step 1: Pull the Docker Image |
| 6 | +```bash |
| 7 | +docker pull decenter/open-container-engine:v1.0.0 |
| 8 | +``` |
| 9 | + |
| 10 | +### Step 2: Create Kubernetes Config File |
| 11 | +Create a file named `k8sConfig.yaml` in your current directory: |
| 12 | + |
| 13 | +```bash |
| 14 | +# Create the config file |
| 15 | +touch k8sConfig.yaml |
| 16 | +``` |
| 17 | + |
| 18 | +Then edit `k8sConfig.yaml` with your Kubernetes cluster configuration: |
| 19 | + |
| 20 | +```yaml |
| 21 | +# Example k8sConfig.yaml content |
| 22 | +apiVersion: v1 |
| 23 | +kind: Config |
| 24 | +clusters: |
| 25 | +- cluster: |
| 26 | + certificate-authority-data: LS0tLS1CRUdJTi... # Your cluster CA |
| 27 | + server: https://your-k8s-api-server:6443 |
| 28 | + name: your-cluster |
| 29 | +contexts: |
| 30 | +- context: |
| 31 | + cluster: your-cluster |
| 32 | + user: your-user |
| 33 | + name: your-context |
| 34 | +current-context: your-context |
| 35 | +users: |
| 36 | +- name: your-user |
| 37 | + user: |
| 38 | + token: eyJhbGciOiJSUzI1... # Your service account token |
| 39 | +``` |
| 40 | +
|
| 41 | +### Step 3: Run the Container |
| 42 | +```bash |
| 43 | +docker run -d \ |
| 44 | + --name container-engine \ |
| 45 | + -p 8080:3000 \ |
| 46 | + -v $(pwd)/k8sConfig.yaml:/app/k8sConfig.yaml:ro \ |
| 47 | + -e DATABASE_URL="postgresql://user:password@host:5432/database" \ |
| 48 | + -e REDIS_URL="redis://host:6379" \ |
| 49 | + -e JWT_SECRET="your-super-secret-jwt-key" \ |
| 50 | + -e DOMAIN_SUFFIX="yourdomain.com" \ |
| 51 | + -e KUBERNETES_NAMESPACE="default" \ |
| 52 | + decenter/open-container-engine:v1.0.0 |
| 53 | +``` |
| 54 | + |
| 55 | +### Step 4: Access the Application |
| 56 | +- Web Interface: http://localhost:8080 |
| 57 | +- Health Check: http://localhost:8080/health |
| 58 | + |
| 59 | +## 📋 Required Environment Variables |
| 60 | + |
| 61 | +| Variable | Description | Example | |
| 62 | +|----------|-------------|---------| |
| 63 | +| `DATABASE_URL` | PostgreSQL connection string | `postgresql://user:pass@host:5432/db` | |
| 64 | +| `REDIS_URL` | Redis connection string | `redis://host:6379` | |
| 65 | +| `JWT_SECRET` | JWT signing secret | `your-super-secret-jwt-key` | |
| 66 | +| `DOMAIN_SUFFIX` | Domain for deployments | `yourdomain.com` | |
| 67 | +| `KUBERNETES_NAMESPACE` | K8s namespace (optional) | `default` | |
| 68 | + |
| 69 | +## 🔧 Optional Environment Variables |
| 70 | + |
| 71 | +| Variable | Description | Default | |
| 72 | +|----------|-------------|---------| |
| 73 | +| `PORT` | Server port | `3000` | |
| 74 | +| `KUBECONFIG_PATH` | Path to kubeconfig | `./k8sConfig.yaml` | |
| 75 | +| `ENVIRONMENT` | Environment mode | `development` | |
| 76 | + |
| 77 | +## 📁 File Structure |
| 78 | +``` |
| 79 | +your-project/ |
| 80 | +├── k8sConfig.yaml # Your Kubernetes config (required) |
| 81 | +└── docker-compose.yml # Optional: for development |
| 82 | +``` |
| 83 | + |
| 84 | +## 🛠️ Development with Docker Compose |
| 85 | + |
| 86 | +For local development with included database and Redis: |
| 87 | + |
| 88 | +```bash |
| 89 | +git clone <repository> |
| 90 | +cd Open-Container-Engine |
| 91 | +docker-compose up |
| 92 | +``` |
| 93 | + |
| 94 | +This will start: |
| 95 | +- PostgreSQL database |
| 96 | +- Redis cache |
| 97 | +- Container Engine application |
| 98 | + |
| 99 | +Access at: http://localhost:3000 |
0 commit comments