📊 Claude Max 5x quota

đang tải…

deploy-recipe L2 Memory

name: deploy-recipe description: Công thức deploy web mới lên VPS KVM4 + HTTPS tự động qua Traefik + DuckDNS metadata: node_type: memory type: reference originSessionId: 0e3c870d-0635-4f27-a7bc-9d7dca789e40

Công thức deploy web mới (HTTPS auto)

VPS KVM4 đã có sẵn Traefik (host network, port 80/443) + Let's Encrypt + DuckDNS wildcard. → Tạo web mới chỉ cần 1 docker-compose có Traefik labels.

Bước 1 — Tạo thư mục

mkdir -p /docker/<NAME>/app
# bỏ code app vào /docker/<NAME>/app/

Bước 2 — Tạo /docker/<NAME>/docker-compose.yml

services:
  <NAME>:
    image: python:3.12-slim          # hoặc node:20-alpine / nginx:alpine
    container_name: <NAME>
    restart: unless-stopped
    working_dir: /app
    command: sh -c "<lệnh chạy app>"
    volumes:
      - ./app:/app:ro
      # mount thêm nếu cần đọc data lulu:
      # - /docker/lulu/data:/docker/lulu/data:ro
    labels:
      - traefik.enable=true
      - traefik.http.routers.<NAME>.rule=Host(`<NAME>.lulu8799.duckdns.org`)
      - traefik.http.routers.<NAME>.entrypoints=websecure
      - traefik.http.routers.<NAME>.tls.certresolver=letsencrypt
      - traefik.http.services.<NAME>.loadbalancer.server.port=<PORT_APP_LISTEN>

Bước 3 — Bật

cd /docker/<NAME> && docker compose up -d
# Đợi ~30s Traefik xin cert Let's Encrypt

→ URL: https://<NAME>.lulu8799.duckdns.org

Cần thay

Đã deploy theo công thức này

Liên quan