Add dev profile + deploy script

This commit is contained in:
Nico 2026-03-30 22:24:13 +02:00
parent 9418aae24f
commit 3133c5bb44
2 changed files with 82 additions and 0 deletions

View File

@ -1,5 +1,18 @@
services: services:
# Production-equivalent: nginx serving Vite build
web: web:
build: . build: .
ports: ports:
- "8080:80" - "8080:80"
# Dev: Vite HMR with live reload
dev:
image: node:20-alpine
working_dir: /app
volumes:
- .:/app
- /app/node_modules
ports:
- "5173:5173"
command: sh -c "npm install && npm run dev -- --host"
profiles: ["dev"]

69
k8s/loop42-web.yaml Normal file
View File

@ -0,0 +1,69 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: loop42-web
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: loop42-web
template:
metadata:
labels:
app: loop42-web
spec:
containers:
- name: loop42-web
image: docker.io/library/loop42-web:latest
imagePullPolicy: Never
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: loop42-web
namespace: default
spec:
selector:
app: loop42-web
ports:
- port: 80
targetPort: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: loop42-web
namespace: default
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
ingressClassName: traefik
tls:
- hosts:
- loop42.de
- www.loop42.de
secretName: loop42-de-tls
rules:
- host: loop42.de
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: loop42-web
port:
number: 80
- host: www.loop42.de
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: loop42-web
port:
number: 80