mirror of
https://github.com/blasseye/WikiJs.git
synced 2025-10-10 12:25:06 +02:00
docs: create applications/ghost
This commit is contained in:
parent
35c1d78699
commit
8466a0eb42
1 changed files with 167 additions and 0 deletions
167
applications/ghost.md
Normal file
167
applications/ghost.md
Normal file
|
@ -0,0 +1,167 @@
|
|||
---
|
||||
title: Untitled Page
|
||||
description:
|
||||
published: true
|
||||
date: 2025-08-28T18:07:31.592Z
|
||||
tags:
|
||||
editor: markdown
|
||||
dateCreated: 2025-08-28T18:07:31.592Z
|
||||
---
|
||||
|
||||
[Ghost](https://ghost.org/) est un CMS open-source, rapide et moderne, orienté **blogging** et **publication de contenu**.
|
||||
Ce guide décrit comment déployer Ghost dans un environnement conteneurisé avec **Docker Compose**, en utilisant une base de données **MySQL** et un reverse proxy **Traefik** pour la gestion du HTTPS.
|
||||
|
||||
---
|
||||
|
||||
## 📂 Arborescence du projet
|
||||
|
||||
```
|
||||
ghost/
|
||||
│── docker-compose.yml
|
||||
│── content/ # Contenu Ghost (thèmes, images, config)
|
||||
│── db/ # Données MySQL
|
||||
│── .env # Variables d’environnement
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ Fichier `docker-compose.yml`
|
||||
|
||||
```yaml
|
||||
services:
|
||||
|
||||
ghost:
|
||||
image: ghost:alpine
|
||||
container_name: ${SERVICE}
|
||||
restart: always
|
||||
environment:
|
||||
database__client: mysql
|
||||
database__connection__host: ghost_db
|
||||
database__connection__user: ${MYSQL_USER}
|
||||
database__connection__password: ${MYSQL_PASSWORD}
|
||||
database__connection__database: ${MYSQL_DATABASE}
|
||||
mail__from: ${MAIL_FROM}
|
||||
mail__transport: SMTP
|
||||
mail__options__host: ${MAIL_HOST}
|
||||
mail__options__port: ${MAIL_PORT}
|
||||
mail__options__secure: ${MAIL_SECURE}
|
||||
mail__options__auth__user: ${MAIL_USER}
|
||||
mail__options__auth__pass: ${MAIL_PASS}
|
||||
url: https://${DOMAIN}
|
||||
volumes:
|
||||
- ./content:/var/lib/ghost/content
|
||||
networks:
|
||||
- traefik_net
|
||||
- ghost_net
|
||||
depends_on:
|
||||
- ghost_db
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.${SERVICE}.rule=Host(`${DOMAIN}`)"
|
||||
- "traefik.http.routers.${SERVICE}.entrypoints=websecure"
|
||||
- "traefik.http.routers.${SERVICE}.tls=true"
|
||||
- "traefik.http.routers.${SERVICE}.tls.certresolver=http"
|
||||
- "traefik.http.routers.${SERVICE}.service=${SERVICE}"
|
||||
- "traefik.http.services.${SERVICE}.loadbalancer.server.port=2368"
|
||||
- "traefik.docker.network=traefik_net"
|
||||
|
||||
ghost_db:
|
||||
image: mysql:8
|
||||
container_name: ${SERVICE}_db
|
||||
restart: always
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
||||
MYSQL_USER: ${MYSQL_USER}
|
||||
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
|
||||
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
||||
volumes:
|
||||
- ./db:/var/lib/mysql
|
||||
networks:
|
||||
- ghost_net
|
||||
|
||||
networks:
|
||||
traefik_net:
|
||||
external: true
|
||||
ghost_net:
|
||||
name: ghost_net
|
||||
driver: bridge
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔐 Variables d’environnement (`.env`)
|
||||
|
||||
Exemple de fichier `.env` :
|
||||
|
||||
```env
|
||||
SERVICE=ghost_blog
|
||||
|
||||
# Domaine
|
||||
DOMAIN=blog.example.com
|
||||
|
||||
# Base de données
|
||||
MYSQL_ROOT_PASSWORD=superpassword
|
||||
MYSQL_USER=ghost
|
||||
MYSQL_PASSWORD=ghostpass
|
||||
MYSQL_DATABASE=ghostdb
|
||||
|
||||
# Mail (SMTP)
|
||||
MAIL_FROM="Ghost Blog <noreply@example.com>"
|
||||
MAIL_HOST=smtp.example.com
|
||||
MAIL_PORT=587
|
||||
MAIL_SECURE=false
|
||||
MAIL_USER=smtp_user
|
||||
MAIL_PASS=smtp_pass
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Déploiement
|
||||
|
||||
1. Créez les répertoires nécessaires :
|
||||
|
||||
```bash
|
||||
mkdir -p ghost/content ghost/db
|
||||
```
|
||||
|
||||
2. Placez le fichier `docker-compose.yml` et `.env` dans le dossier `ghost/`.
|
||||
|
||||
3. Lancez le déploiement :
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
4. Vérifiez que les conteneurs tournent :
|
||||
|
||||
```bash
|
||||
docker ps
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🌍 Accès
|
||||
|
||||
* L’interface Ghost sera disponible à :
|
||||
**[https://blog.example.com](https://blog.example.com)**
|
||||
|
||||
* L’administration est accessible via :
|
||||
**[https://blog.example.com/ghost](https://blog.example.com/ghost)**
|
||||
|
||||
---
|
||||
|
||||
## ✨ Points importants
|
||||
|
||||
* **Sauvegardes** :
|
||||
|
||||
* `./content` contient tous les fichiers Ghost (images, thèmes, config).
|
||||
* `./db` contient la base de données MySQL.
|
||||
* **Traefik** gère automatiquement les certificats SSL via Let’s Encrypt.
|
||||
* **Scalabilité** : Ghost est prévu pour un usage monolithique, mais peut être déployé derrière un load balancer.
|
||||
|
||||
---
|
||||
|
||||
## 📌 Conclusion
|
||||
|
||||
Avec cette configuration, vous disposez d’un **CMS Ghost auto-hébergé**, sécurisé avec HTTPS grâce à **Traefik**, et supportant une **base MySQL persistante**.
|
||||
Idéal pour héberger un blog personnel ou professionnel tout en gardant la maîtrise complète de vos données.
|
Loading…
Add table
Add a link
Reference in a new issue