From 871baf8f9284e8502fb933dd27048db78bdb24c6 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 17 Oct 2025 09:55:56 +0000 Subject: [PATCH] Merge perso and pro on same Caddy --- .gitignore | 0 Caddyfile | 18 ++++++++++ README.md | 45 ++++++++++++++++++++++++ docker-compose.yml | 15 ++++++++ html-perso/index.html | 10 ++++++ html-perso/index.html.test | 50 ++++++++++++++++++++++++++ html-perso/style.css | 72 ++++++++++++++++++++++++++++++++++++++ html-pro/index.html | 11 ++++++ html-pro/versions.html | 13 +++++++ html/index.html | 10 ++++++ html/index.html.test | 50 ++++++++++++++++++++++++++ html/style.css | 72 ++++++++++++++++++++++++++++++++++++++ 12 files changed, 366 insertions(+) create mode 100644 .gitignore create mode 100644 Caddyfile create mode 100644 README.md create mode 100644 docker-compose.yml create mode 100644 html-perso/index.html create mode 100644 html-perso/index.html.test create mode 100644 html-perso/style.css create mode 100644 html-pro/index.html create mode 100644 html-pro/versions.html create mode 100644 html/index.html create mode 100644 html/index.html.test create mode 100644 html/style.css diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..ae33f8a --- /dev/null +++ b/Caddyfile @@ -0,0 +1,18 @@ +:80 { + @pro host pro.lucasroyer.fr + handle @pro { + root * /srv/pro + file_server + } + + @perso host lucasroyer.fr + handle @perso { + root * /srv/perso + file_server + } + + # fallback + handle { + respond "Not Found" 404 + } +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..798f9c3 --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ +## Site web Caddy avec Docker Compose + +Un site web est un ensemble de pages web accessibles via Internet, généralement regroupées sous un même domaine. Ces pages peuvent contenir des informations sous forme de texte, images, vidéos, ou autres médias. https://caddyserver.com/ + +## Prérequis + +- Git, Docker & Docker Compose installés + +- Cette installation est faite pour fonctionner derrière un reverse-proxy. Exemple ici : https://gitea.lucasroyer.fr/server/reverse-proxy + +## Installation + +1. Clonez ce dépôt : +```bash +git clone https://gitea.lucasroyer.fr/server/gitea.git +cd gitea +``` +2. Modifiez app.env pour ajouter un mot de passe en remplaçant `mypassword` : +```bash +cp app.public.env app.env +nano app.env +``` + +```ini +GITEA__database__DB_TYPE=postgres +GITEA__database__HOST=db:5432 +GITEA__database__NAME=gitea +GITEA__database__USER=gitea +GITEA__database__PASSWD=mypassword #replace +``` +2. Modifiez db.env avec le même mot de passe : +```bash +cp db.public.env db.env +nano db.env +``` +```ini +POSTGRES_USER=gitea +POSTGRES_PASSWORD=mypassword #replace +POSTGRES_DB=gitea +``` +4. Lancez et surveillez les conteneurs : +```bash +sudo docker compose up -d +sudo docker compose logs -f +``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..15742fc --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +services: + web: + image: caddy:latest + container_name: site-perso + restart: always + volumes: + - /home/lucas/site-perso/html-perso:/srv/perso # Dossier contenant les fichiers statiques + - /home/lucas/site-perso/html-pro:/srv/pro # Dossier contenant les fichiers statiques + - /home/lucas/site-perso/Caddyfile:/etc/caddy/Caddyfile # Fichier de configuration de Caddy + networks: + - reverse-proxy + +networks: + reverse-proxy: + external: true diff --git a/html-perso/index.html b/html-perso/index.html new file mode 100644 index 0000000..8994b88 --- /dev/null +++ b/html-perso/index.html @@ -0,0 +1,10 @@ + + + + + Lucas Royer + + +

lucasroyer.fr : Site en construction

+ + diff --git a/html-perso/index.html.test b/html-perso/index.html.test new file mode 100644 index 0000000..0b9dec9 --- /dev/null +++ b/html-perso/index.html.test @@ -0,0 +1,50 @@ + + + + Nanteshowdown + + + +
+

NanteShowDown

+ +
+ +
+
+

Le Showdown

+

Présentation

+ Wikipédia +
+ +
+

Entraînement

+

Rejoignez-nous tous les samedis à 9h pour un entraînement de Showdown! Notre entraîneur expérimenté vous aidera à améliorer votre technique et à vous amuser tout en pratiquant ce sport passionnant.

+ Inscrivez-vous dès maintenant! +
+ +
+

Contact

+

Pour plus d'informations sur notre club ou pour nous contacter, envoyez-nous un e-mail à l'adresse suivante:

+ info@nanteshowdown.com +
+ +
+

Financements

+

Nous sommes toujours à la recherche de financements !

+
+
+ + + + + diff --git a/html-perso/style.css b/html-perso/style.css new file mode 100644 index 0000000..020a5ae --- /dev/null +++ b/html-perso/style.css @@ -0,0 +1,72 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + color: #000; + background-color: #fff; + font-size: 18px; /* Augmentation de la taille de la police */ + line-height: 1.5; +} + +header { + background-color: #000; + color: #fff; + padding: 20px; + text-align: center; +} + +nav ul { + list-style: none; + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100%; +} + +nav li { + padding: 10px; + margin: 0 10px; +} + +nav a { + color: #000; + text-decoration: none; + font-size: 20px; /* Augmentation de la taille de la police */ +} + +main { + max-width: 800px; + margin: 0 auto; + padding: 20px; +} + +section { + margin-bottom: 40px; +} + +h2 { + color: #000; + font-size: 36px; /* Augmentation de la taille de la police */ + font-weight: bold; + margin-bottom: 20px; +} + +a { + background-color: #FED330; + color: #000; + display: inline-block; + padding: 10px; + text-decoration: none; +} + +a:hover { + background-color: #FFC300; +} +footer { + background-color: #eee; + color: #000; + padding: 20px; + text-align: center; +} \ No newline at end of file diff --git a/html-pro/index.html b/html-pro/index.html new file mode 100644 index 0000000..f42b553 --- /dev/null +++ b/html-pro/index.html @@ -0,0 +1,11 @@ + + + + + Lucas Royer Pro + + +

pro.lucasroyer.fr : deuxième site en construction

+Versions + + diff --git a/html-pro/versions.html b/html-pro/versions.html new file mode 100644 index 0000000..d075570 --- /dev/null +++ b/html-pro/versions.html @@ -0,0 +1,13 @@ + + + + + Versions + + +

template-generator:0.02

+

fleet-algorithm:0.01

+

fleetrunner:0.001

+

fleetphilippe:0.001

+ + diff --git a/html/index.html b/html/index.html new file mode 100644 index 0000000..8994b88 --- /dev/null +++ b/html/index.html @@ -0,0 +1,10 @@ + + + + + Lucas Royer + + +

lucasroyer.fr : Site en construction

+ + diff --git a/html/index.html.test b/html/index.html.test new file mode 100644 index 0000000..0b9dec9 --- /dev/null +++ b/html/index.html.test @@ -0,0 +1,50 @@ + + + + Nanteshowdown + + + +
+

NanteShowDown

+ +
+ +
+
+

Le Showdown

+

Présentation

+ Wikipédia +
+ +
+

Entraînement

+

Rejoignez-nous tous les samedis à 9h pour un entraînement de Showdown! Notre entraîneur expérimenté vous aidera à améliorer votre technique et à vous amuser tout en pratiquant ce sport passionnant.

+ Inscrivez-vous dès maintenant! +
+ +
+

Contact

+

Pour plus d'informations sur notre club ou pour nous contacter, envoyez-nous un e-mail à l'adresse suivante:

+ info@nanteshowdown.com +
+ +
+

Financements

+

Nous sommes toujours à la recherche de financements !

+
+
+ + + + + diff --git a/html/style.css b/html/style.css new file mode 100644 index 0000000..020a5ae --- /dev/null +++ b/html/style.css @@ -0,0 +1,72 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + color: #000; + background-color: #fff; + font-size: 18px; /* Augmentation de la taille de la police */ + line-height: 1.5; +} + +header { + background-color: #000; + color: #fff; + padding: 20px; + text-align: center; +} + +nav ul { + list-style: none; + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100%; +} + +nav li { + padding: 10px; + margin: 0 10px; +} + +nav a { + color: #000; + text-decoration: none; + font-size: 20px; /* Augmentation de la taille de la police */ +} + +main { + max-width: 800px; + margin: 0 auto; + padding: 20px; +} + +section { + margin-bottom: 40px; +} + +h2 { + color: #000; + font-size: 36px; /* Augmentation de la taille de la police */ + font-weight: bold; + margin-bottom: 20px; +} + +a { + background-color: #FED330; + color: #000; + display: inline-block; + padding: 10px; + text-decoration: none; +} + +a:hover { + background-color: #FFC300; +} +footer { + background-color: #eee; + color: #000; + padding: 20px; + text-align: center; +} \ No newline at end of file