Date : 30-12-2025 22:15 Statut : En attente de validation
Créer un mini projet "pizza" qui affiche une page avec le titre "Pizza", hébergé sur GitHub, développé sur vscode.local, et exposé sur pizza.test.nowhere84.com.
| Composant | Choix | Justification |
|---|---|---|
| Runtime | Bun 1.3.5 (baseline) | Déjà installé sur vscode.local, rapide |
| Framework | Elysia | Léger, parfait pour un mini projet |
| Hébergement code | GitHub | Comme demandé |
| Déploiement | prod-portainer | Docker avec shortcut bun |
# Créer repo gouroubleu/pizza sur GitHub
gh repo create gouroubleu/pizza --public --description "Mini projet Pizza"
# Cloner et initialiser
cd ~/WS
git clone https://github.com/gouroubleu/pizza.git
cd pizza
# Init Bun + Elysia
~/.bun/bin/bun init
~/.bun/bin/bun add elysia @elysiajs/html
# Créer src/index.ts avec page Pizza
Code prévu (src/index.ts) :
import { Elysia } from 'elysia';
import { html } from '@elysiajs/html';
const app = new Elysia()
.use(html())
.get('/', () => `
<!DOCTYPE html>
<html>
<head>
<title>Pizza</title>
<style>
body {
font-family: system-ui;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background: linear-gradient(135deg, #ff6b6b, #ffa502);
}
h1 {
font-size: 5rem;
color: white;
text-shadow: 3px 3px 0 #c0392b;
}
</style>
</head>
<body>
<h1>Pizza</h1>
</body>
</html>
`)
.listen(3000);
console.log(`Pizza server running at http://localhost:${app.server?.port}`);
# Ajouter *.test.nowhere84.com → 82.65.119.221
/mnt/stock_36to/data/33800-stack/scripts/dns/add-wildcard.sh test
Résultat : *.test.nowhere84.com pointera vers Nginx (82.65.119.221)
Créer /etc/nginx/sites-available/pizza.test.nowhere84.com :
server {
listen 443 ssl http2;
server_name pizza.test.nowhere84.com;
ssl_certificate /etc/letsencrypt/live/33800.nowhere84.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/33800.nowhere84.com/privkey.pem;
location / {
proxy_pass http://192.168.1.11:3100;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Note : Il faudra peut-être générer un nouveau certificat SSL pour
*.test.nowhere84.comou utiliser un certificat existant.
# Build et run
docker build -t pizza:prod .
docker run -d --name pizza-prod -p 3100:3000 pizza:prod
| Service | Port interne | Port exposé | URL |
|---|---|---|---|
| pizza | 3000 | 3100 | pizza.test.nowhere84.com |
SSL : Utiliser le certificat wildcard existant (33800.nowhere84.com) ou en créer un nouveau pour *.test.nowhere84.com ?
*.test.nowhere84.comEnvironnement : Déployer sur PROD (prod-portainer) ou DEV (dev-portainer) ?
pizza/
├── src/
│ └── index.ts
├── Dockerfile
├── package.json
├── tsconfig.json
└── README.md
# 1. Créer repo GitHub
gh repo create gouroubleu/pizza --public
# 2. Dev sur vscode.local
ssh gouroubleu@vscode.local
cd ~/WS && git clone ... && cd pizza
~/.bun/bin/bun init && ~/.bun/bin/bun add elysia @elysiajs/html
# 3. DNS
/mnt/stock_36to/data/33800-stack/scripts/dns/add-wildcard.sh test
# 4. Nginx config + SSL
ssh gouroubleu@nginx.local "sudo certbot certonly --nginx -d '*.test.nowhere84.com'"
# 5. Deploy
docker build -t pizza:prod . && docker run -d --name pizza-prod -p 3100:3000 pizza:prod
En attente de ta validation pour lancer l'exécution.