Compare commits
1 Commits
docs/add-f
...
chore/k8s-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d04bfe418b |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -57,3 +57,4 @@ core.*
|
||||
!resources/**/*.png
|
||||
!resources/**/*.jpg
|
||||
!resources/**/*.jpeg
|
||||
.worktrees/
|
||||
|
||||
9
Makefile
9
Makefile
@@ -10,12 +10,9 @@
|
||||
# --port "80:80@loadbalancer" \
|
||||
# --port "443:443@loadbalancer" \
|
||||
# --volume $(pwd)/.worktrees:/worktrees \
|
||||
# --volume $(pwd):/project-root \
|
||||
# --volume k3d-dev-images:/k3d/images \
|
||||
# --k3s-arg "--disable=traefik@server:0"
|
||||
# --volume $(pwd):/project-root
|
||||
#
|
||||
# Then install nginx ingress:
|
||||
# kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/cloud/deploy.yaml
|
||||
# k3d includes Traefik ingress controller by default
|
||||
|
||||
# Detect if we're in a worktree or project root
|
||||
GIT_DIR := $(shell git rev-parse --git-dir 2>/dev/null)
|
||||
@@ -142,7 +139,7 @@ k-composer: ## Run composer (usage: make k-composer CMD="install")
|
||||
k-vite: ## Run Vite dev server in k8s pod
|
||||
@echo "🎨 Starting Vite dev server in pod..."
|
||||
@echo " Access at: http://vite.$(K8S_HOST)"
|
||||
@kubectl -n $(K8S_NS) exec deploy/web -- npm run dev
|
||||
@kubectl -n $(K8S_NS) exec deploy/web -- sh -c "VITE_HMR_HOST=vite.$(K8S_HOST) npm run dev"
|
||||
|
||||
k-test: ## Run tests in k8s pod
|
||||
@echo "🧪 Running tests in k8s pod..."
|
||||
|
||||
@@ -81,9 +81,6 @@ spec:
|
||||
echo "Installing/updating npm dependencies..."
|
||||
npm install --no-audit --no-fund
|
||||
|
||||
echo "Building frontend assets..."
|
||||
npm run build
|
||||
|
||||
echo "Running migrations..."
|
||||
php artisan migrate --force
|
||||
|
||||
@@ -99,25 +96,25 @@ spec:
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "1Gi"
|
||||
cpu: "1000m"
|
||||
cpu: "500m"
|
||||
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
path: /register
|
||||
port: 80
|
||||
initialDelaySeconds: 300
|
||||
initialDelaySeconds: 90
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
path: /register
|
||||
port: 80
|
||||
initialDelaySeconds: 240
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 3
|
||||
failureThreshold: 6
|
||||
|
||||
@@ -4,7 +4,7 @@ metadata:
|
||||
name: web
|
||||
namespace: ${NS}
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
ingressClassName: traefik
|
||||
rules:
|
||||
# Main application domain
|
||||
- host: ${K8S_HOST}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "vite build",
|
||||
"dev": "vite",
|
||||
"dev": "vite --host 0.0.0.0",
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && sed -i.bak 's/\\/commits\\//\\/commit\\//g' CHANGELOG.md && rm CHANGELOG.md.bak"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -10,4 +10,17 @@ export default defineConfig({
|
||||
refresh: true,
|
||||
}),
|
||||
],
|
||||
server: {
|
||||
host: "0.0.0.0", // Listen on all interfaces (required for Docker/k8s)
|
||||
port: 5173,
|
||||
strictPort: false, // Allow fallback port if 5173 is taken
|
||||
allowedHosts: [".cannabrands.test"], // Allow all subdomains
|
||||
hmr: {
|
||||
// K8s mode: use vite subdomain through ingress (port 80)
|
||||
// Local mode: use localhost:5173
|
||||
host: process.env.VITE_HMR_HOST || "localhost",
|
||||
clientPort: process.env.VITE_HMR_HOST ? 80 : 5173,
|
||||
protocol: "http",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user