- docs/architecture.md: full architecture with Astro 5 SSR vs Next.js/Nuxt justification, component diagram, data flow, multi-domain routing, SEO strategy, performance targets, and caching strategy - docs/frontend.md, bridge.md, domains.md, seo.md, deployment.md: stubs with implementation detail for each layer - config/domains/newsproject.bitreport.pt.json: first domain config - project skeleton: frontend/, bridge/, wordpress/, config/, deploy/ Covers BIT-348 deliverables. Push pending Gitea repo creation. Co-Authored-By: Paperclip <[email protected]>
4.6 KiB
4.6 KiB
Deployment — LXC on Proxmox
Status: Stub — implementation in progress (BIT-345)
Overview
The platform runs on a single LXC container on Proxmox for the initial test deployment. The container hosts all services: Nginx reverse proxy, Astro frontend (Node.js), Fastify bridge (Node.js), WordPress (Docker), MySQL (Docker), and Redis.
LXC Container Spec
| Property | Value |
|---|---|
| Name | news-project-test |
| OS | Ubuntu 24.04 LTS |
| CPU | 2 cores |
| RAM | 4 GB |
| Disk | 20 GB |
| Network | Bridge (vmbr0), DHCP or static IP |
| Domain | newsproject.bitreport.pt |
Service Layout
LXC: news-project-test
│
├── nginx (host) :80, :443
│ └── reverse proxy → :4321 (Astro)
│
├── astro-frontend (PM2 / systemd) :4321
│ └── node dist/server/entry.mjs
│
├── fastify-bridge (PM2 / systemd) :3200
│ └── node dist/server.js
│
├── redis (host or Docker) :6379
│
└── Docker Compose
├── wordpress :8080
└── mysql :3306 (internal only)
Setup Script (deploy/lxc/setup.sh)
#!/bin/bash
set -euo pipefail
# System
apt-get update && apt-get upgrade -y
apt-get install -y curl git nginx redis-server docker.io docker-compose-plugin
# Node.js 22
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y nodejs
# PM2
npm install -g pm2
# Redis (start + enable)
systemctl enable --now redis-server
# Docker
systemctl enable --now docker
echo "Base setup complete. Deploy services manually or run per-service scripts."
Nginx Config (deploy/nginx/newsproject.conf)
server {
listen 80;
server_name newsproject.bitreport.pt;
location / {
proxy_pass http://127.0.0.1:4321;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
HTTPS/TLS is terminated at Nginx Proxy Manager (NPM), which the user configures manually.
WordPress (Docker Compose)
# wordpress/docker-compose.yml
services:
db:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: wordpress
MYSQL_USER: wp
MYSQL_PASSWORD: wp_secret
volumes:
- db_data:/var/lib/mysql
wordpress:
image: wordpress:6.7-php8.3-apache
depends_on:
- db
ports:
- "8080:80"
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DB_USER: wp
WORDPRESS_DB_PASSWORD: wp_secret
WORDPRESS_CONFIG_EXTRA: |
define('WP_HOME', 'http://wp.newsproject.local');
define('WP_SITEURL', 'http://wp.newsproject.local');
volumes:
- wp_data:/var/www/html
- ./plugins:/var/www/html/wp-content/plugins/custom
volumes:
db_data:
wp_data:
Service Start (PM2)
# Frontend
cd /opt/news-platform/frontend
pm2 start dist/server/entry.mjs --name astro-frontend -- --port 4321
# Bridge
cd /opt/news-platform/bridge
pm2 start dist/server.js --name fastify-bridge -- --port 3200
pm2 save
pm2 startup
Deployment Checklist
- LXC container created and running
- Base packages installed (Node 22, nginx, redis, docker)
- Git repo cloned to
/opt/news-platform/ config/domains/newsproject.bitreport.pt.jsonpopulated- Bridge dependencies installed and built
- Frontend dependencies installed and built
- WordPress Docker stack running (
docker compose up -d) - WordPress configured (admin user, permalink structure
/%category%/%postname%/) - Bridge invalidator plugin activated in WP
- PM2 processes started and saved
- Nginx config symlinked and nginx reloaded
- DNS points
newsproject.bitreport.ptto container IP - NPM configured for HTTPS (user step)
- Smoke test:
curl https://newsproject.bitreport.pt/returns HTML - Sitemap accessible at
/sitemap.xml
Future: Multi-Container
When the platform scales beyond a single test container, each service moves to its own LXC or VM:
| Service | Container |
|---|---|
| Astro frontend | news-frontend-01, news-frontend-02 |
| Fastify bridge | news-bridge-01 |
| WordPress | news-wp-01 |
| MySQL | news-db-01 |
| Redis | news-redis-01 |
| Nginx LB | news-lb-01 |
Cloudflare sits in front of the load balancer.