chore: upgrade to Debian 13 (Trixie), Node.js 22 LTS, PostgreSQL 17
- LXC templates: debian-13-standard (default) - Docker images: node:22-alpine, postgres:17-alpine - TypeScript target: ES2022 - Updated template references (Ubuntu 24.04, Alpine 3.20) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c5808dbf55
commit
acceefe99b
@ -10,14 +10,14 @@ Du bist ein Docker-Agent für React + Node.js Webprojekte.
|
||||
|
||||
### Backend (Node.js/Express)
|
||||
```dockerfile
|
||||
FROM node:20-alpine AS builder
|
||||
FROM node:22-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci --only=production
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM node:20-alpine
|
||||
FROM node:22-alpine
|
||||
WORKDIR /app
|
||||
RUN addgroup -g 1001 appgroup && adduser -u 1001 -G appgroup -s /bin/sh -D appuser
|
||||
COPY --from=builder /app/dist ./dist
|
||||
@ -31,7 +31,7 @@ CMD ["node", "dist/index.js"]
|
||||
|
||||
### Frontend (React)
|
||||
```dockerfile
|
||||
FROM node:20-alpine AS builder
|
||||
FROM node:22-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
@ -80,7 +80,7 @@ services:
|
||||
retries: 3
|
||||
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
image: postgres:17-alpine
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
environment:
|
||||
|
||||
@ -71,9 +71,9 @@ npx tsc --init
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"target": "ES2022",
|
||||
"module": "commonjs",
|
||||
"lib": ["ES2020"],
|
||||
"lib": ["ES2022"],
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"strict": true,
|
||||
|
||||
@ -15,7 +15,7 @@ PVE_TOKEN_ID=$PVE_TOKEN_ID # API Token ID
|
||||
PVE_TOKEN_SECRET=$PVE_TOKEN_SECRET # API Token Secret
|
||||
PVE_NODE=$PVE_NODE # Node-Name (default: pve)
|
||||
PVE_STORAGE=$PVE_STORAGE # Storage (default: local-lvm)
|
||||
LXC_TEMPLATE=$LXC_TEMPLATE # Template (default: debian-12-standard)
|
||||
LXC_TEMPLATE=$LXC_TEMPLATE # Template (default: debian-13-standard)
|
||||
```
|
||||
|
||||
## LXC-CONTAINER ERSTELLEN
|
||||
@ -49,10 +49,10 @@ curl -sk -X POST "https://$PVE_HOST:$PVE_PORT/api2/json/nodes/$PVE_NODE/lxc" \
|
||||
ssh root@$PVE_HOST << 'EOF'
|
||||
# Template herunterladen falls nötig
|
||||
pveam update
|
||||
pveam download local debian-12-standard_12.7-1_amd64.tar.zst
|
||||
pveam download local debian-13-standard_12.7-1_amd64.tar.zst
|
||||
|
||||
# Container erstellen
|
||||
pct create $VMID local:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst \
|
||||
pct create $VMID local:vztmpl/debian-13-standard_12.7-1_amd64.tar.zst \
|
||||
--hostname app-staging \
|
||||
--storage local-lvm \
|
||||
--rootfs local-lvm:8 \
|
||||
@ -80,7 +80,7 @@ ssh root@$PVE_HOST "pct exec $VMID -- bash -c '
|
||||
apt install -y curl git sudo wget gnupg2 ca-certificates
|
||||
|
||||
# Node.js 20 LTS
|
||||
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
||||
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
||||
apt install -y nodejs
|
||||
|
||||
# Docker (in unprivileged LXC mit nesting)
|
||||
@ -229,6 +229,6 @@ Nutze `/ssh-deploy` mit der LXC-IP als SSH_HOST.
|
||||
## TEMPLATES (häufig genutzt)
|
||||
| Template | Verwendung |
|
||||
|----------|-----------|
|
||||
| `debian-12-standard` | Standard für Webapps |
|
||||
| `ubuntu-22.04-standard` | Alternative mit Ubuntu |
|
||||
| `alpine-3.19-default` | Minimal, für einfache Services |
|
||||
| `debian-13-standard` | Standard für Webapps (Trixie) |
|
||||
| `ubuntu-24.04-standard` | Alternative mit Ubuntu |
|
||||
| `alpine-3.20-default` | Minimal, für einfache Services |
|
||||
|
||||
@ -38,7 +38,7 @@ PVE_TOKEN_ID=
|
||||
PVE_TOKEN_SECRET=
|
||||
PVE_NODE=pve
|
||||
PVE_STORAGE=local-lvm
|
||||
LXC_TEMPLATE=debian-12-standard
|
||||
LXC_TEMPLATE=debian-13-standard
|
||||
# Token erstellen: Datacenter > Permissions > API Tokens
|
||||
|
||||
# -------------------------------------------
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user