Merge perso and pro on same Caddy

This commit is contained in:
Lucas
2025-10-17 09:55:56 +00:00
commit 871baf8f92
12 changed files with 366 additions and 0 deletions

0
.gitignore vendored Normal file
View File

18
Caddyfile Normal file
View File

@@ -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
}
}

45
README.md Normal file
View File

@@ -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
```

15
docker-compose.yml Normal file
View File

@@ -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

10
html-perso/index.html Normal file
View File

@@ -0,0 +1,10 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Lucas Royer</title>
</head>
<body>
<h2>lucasroyer.fr : Site en construction</h2>
</body>
</html>

View File

@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<title>Nanteshowdown</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<h1>NanteShowDown</h1>
<nav>
<ul>
<li><a href="#">Accueil</a></li>
<li><a href="#">Le Showdown</a></li>
<li><a href="#">Entraînement</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
<main>
<section>
<h2>Le Showdown</h2>
<p>Présentation</p>
<a href="https://fr.wikipedia.org/wiki/Showdown_(sport)">Wikipédia</a>
</section>
<section>
<h2>Entraînement</h2>
<p>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.</p>
<a href="#">Inscrivez-vous dès maintenant!</a>
</section>
<section>
<h2>Contact</h2>
<p>Pour plus d'informations sur notre club ou pour nous contacter, envoyez-nous un e-mail à l'adresse suivante:</p>
<a href="mailto:info@nanteshowdown.com">info@nanteshowdown.com</a>
</section>
<section>
<h2>Financements</h2>
<p>Nous sommes toujours à la recherche de financements !</p>
</section>
</main>
<footer>
<p>&copy; Nanteshowdown 2023</p>
</footer>
</body>
</html>

72
html-perso/style.css Normal file
View File

@@ -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;
}

11
html-pro/index.html Normal file
View File

@@ -0,0 +1,11 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Lucas Royer Pro</title>
</head>
<body>
<h2>pro.lucasroyer.fr : deuxième site en construction</h2>
<a href="versions.html">Versions</a>
</body>
</html>

13
html-pro/versions.html Normal file
View File

@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Versions</title>
</head>
<body>
<p>template-generator:0.02</p>
<p>fleet-algorithm:0.01</p>
<p>fleetrunner:0.001</p>
<p>fleetphilippe:0.001</p>
</body>
</html>

10
html/index.html Normal file
View File

@@ -0,0 +1,10 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Lucas Royer</title>
</head>
<body>
<h2>lucasroyer.fr : Site en construction</h2>
</body>
</html>

50
html/index.html.test Normal file
View File

@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<title>Nanteshowdown</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<h1>NanteShowDown</h1>
<nav>
<ul>
<li><a href="#">Accueil</a></li>
<li><a href="#">Le Showdown</a></li>
<li><a href="#">Entraînement</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
<main>
<section>
<h2>Le Showdown</h2>
<p>Présentation</p>
<a href="https://fr.wikipedia.org/wiki/Showdown_(sport)">Wikipédia</a>
</section>
<section>
<h2>Entraînement</h2>
<p>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.</p>
<a href="#">Inscrivez-vous dès maintenant!</a>
</section>
<section>
<h2>Contact</h2>
<p>Pour plus d'informations sur notre club ou pour nous contacter, envoyez-nous un e-mail à l'adresse suivante:</p>
<a href="mailto:info@nanteshowdown.com">info@nanteshowdown.com</a>
</section>
<section>
<h2>Financements</h2>
<p>Nous sommes toujours à la recherche de financements !</p>
</section>
</main>
<footer>
<p>&copy; Nanteshowdown 2023</p>
</footer>
</body>
</html>

72
html/style.css Normal file
View File

@@ -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;
}