Skip to content

Commit 2fa28a7

Browse files
author
secus
committed
Update k8sConfig path to k8sConfigTest.yaml
1 parent f06d91d commit 2fa28a7

4 files changed

Lines changed: 134 additions & 3 deletions

File tree

.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ DOMAIN_SUFFIX=vinhomes.co.uk
2323

2424
# Logging
2525
RUST_LOG=container_engine=debug,tower_http=debug
26-
KUBECONFIG_PATH=./k8sConfig.yaml
26+
KUBECONFIG_PATH=./k8sConfigTest.yaml

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ COPY --from=frontend-builder /app/dist ./apps/container-engine-frontend/dist
7474
# Copy migrations
7575
COPY --from=backend-builder /app/migrations ./migrations
7676

77-
# Copy configuration files if needed
78-
COPY k8sConfig.yaml* ./
77+
# Note: k8sConfig.yaml should be mounted at runtime
78+
# User should create k8sConfig.yaml locally and mount it with:
79+
# docker run -v $(pwd)/k8sConfig.yaml:/app/k8sConfig.yaml:ro
7980

8081
# Change ownership to app user
8182
RUN chown -R appuser:appuser /app

README-DOCKER.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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

k8sConfigTest.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
apiVersion: v1
2+
clusters:
3+
- cluster:
4+
certificate-authority: /home/your_profile/.minikube/ca.crt
5+
extensions:
6+
- extension:
7+
last-update: Sat, 13 Sep 2025 14:28:36 +07
8+
provider: minikube.sigs.k8s.io
9+
version: v1.37.0
10+
name: cluster_info
11+
server: https://192.168.49.2:8443
12+
name: minikube
13+
contexts:
14+
- context:
15+
cluster: minikube
16+
extensions:
17+
- extension:
18+
last-update: Sat, 13 Sep 2025 14:28:36 +07
19+
provider: minikube.sigs.k8s.io
20+
version: v1.37.0
21+
name: context_info
22+
namespace: default
23+
user: minikube
24+
name: minikube
25+
current-context: minikube
26+
kind: Config
27+
users:
28+
- name: minikube
29+
user:
30+
client-certificate: /home/your_profile/.minikube/profiles/minikube/client.crt
31+
client-key: /home/your_profile/.minikube/profiles/minikube/client.key

0 commit comments

Comments
 (0)