feat: add Podman compatibility with non-privileged ports

- Change Docker ports from 80/8000 to 8081/8080 (non-privileged)
- Update CORS_ORIGINS in docker-compose.yml and .env.docker
- Update all documentation (README.md, DOCKER.md) with new ports
- Add Podman compatibility section to CHANGELOG.md
- Enable podman-compose usage without root privileges
This commit is contained in:
2025-11-26 06:11:38 +01:00
parent 75a251dfe8
commit 6654aa4248
5 changed files with 29 additions and 16 deletions

View File

@@ -8,8 +8,8 @@ SECRET_KEY=CHANGEZ-MOI-cle-secrete-unique-minimum-32-caracteres-obligatoire
# Base de données (stockée dans le volume ./data) # Base de données (stockée dans le volume ./data)
DATABASE_URL=sqlite+aiosqlite:////data/school_management.db DATABASE_URL=sqlite+aiosqlite:////data/school_management.db
# CORS - Ajustez selon vos domaines # CORS - Ajustez selon vos domaines (ports Docker/Podman: 8080/8081)
CORS_ORIGINS=["http://localhost","http://localhost:80","https://votre-domaine.com"] CORS_ORIGINS=["http://localhost:8081","http://localhost:8080","http://localhost:3000","https://votre-domaine.com"]
# Logging # Logging
LOG_LEVEL=INFO LOG_LEVEL=INFO

View File

@@ -12,6 +12,10 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/lang/fr/).
### 🎉 Réécriture Complète (Flask → FastAPI + Vue.js) ### 🎉 Réécriture Complète (Flask → FastAPI + Vue.js)
#### Added #### Added
- **Podman Compatibility** : Support complet sans privilèges root
- Ports non-privilégiés (8080/8081 au lieu de 80/8000)
- Compatible docker-compose et podman-compose
- Documentation complète dans DOCKER.md
- **Backend FastAPI** : API REST JSON pure avec support async - **Backend FastAPI** : API REST JSON pure avec support async
- FastAPI 0.115+ - FastAPI 0.115+
- SQLAlchemy 2.0.36+ avec aiosqlite - SQLAlchemy 2.0.36+ avec aiosqlite

View File

@@ -27,9 +27,11 @@ docker-compose up -d
``` ```
**Accès :** **Accès :**
- Frontend : http://localhost - Frontend : http://localhost:8081
- API : http://localhost:8000 - API : http://localhost:8080
- Documentation API : http://localhost:8000/api/v2/docs - Documentation API : http://localhost:8080/api/v2/docs
> 💡 **Compatibilité Podman** : Les ports 8080/8081 (>1024) permettent l'utilisation sans privilèges root
--- ---
@@ -186,10 +188,10 @@ Les services incluent des healthchecks automatiques :
```bash ```bash
# Vérifier la santé du backend # Vérifier la santé du backend
curl http://localhost:8000/api/v2/health curl http://localhost:8080/api/v2/health
# Vérifier la santé du frontend # Vérifier la santé du frontend
curl http://localhost/ curl http://localhost:8081/
# Voir le statut Docker # Voir le statut Docker
docker-compose ps docker-compose ps
@@ -268,7 +270,7 @@ server {
server_name notytex.example.com; server_name notytex.example.com;
location / { location / {
proxy_pass http://localhost:80; proxy_pass http://localhost:8081;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

View File

@@ -32,26 +32,33 @@ npm install
npm run dev npm run dev
``` ```
### **Accès** ### **Accès (Mode Développement)**
- **Frontend** : http://localhost:3000 - **Frontend** : http://localhost:3000
- **API Backend** : http://localhost:8000 - **API Backend** : http://localhost:8000
- **Documentation API** : http://localhost:8000/api/v2/docs - **Documentation API** : http://localhost:8000/api/v2/docs
- **ReDoc** : http://localhost:8000/api/v2/redoc - **ReDoc** : http://localhost:8000/api/v2/redoc
### **Déploiement avec Docker** 🐳 ### **Déploiement avec Docker / Podman** 🐳
```bash ```bash
# Configuration # Configuration
cp .env.docker .env cp .env.docker .env
# Éditez .env et changez SECRET_KEY # Éditez .env et changez SECRET_KEY
# Démarrage # Démarrage (Docker ou Podman)
docker-compose up -d docker-compose up -d
# ou
# Accès: http://localhost podman-compose up -d
``` ```
**Accès (Mode Docker/Podman) :**
- **Frontend** : http://localhost:8081
- **API Backend** : http://localhost:8080
- **Documentation API** : http://localhost:8080/api/v2/docs
> 💡 **Ports sans privilèges** : Les ports 8080/8081 permettent l'utilisation avec Podman sans root
📖 **Documentation complète** : [`DOCKER.md`](DOCKER.md) 📖 **Documentation complète** : [`DOCKER.md`](DOCKER.md)
--- ---

View File

@@ -9,11 +9,11 @@ services:
container_name: notytex-backend container_name: notytex-backend
restart: unless-stopped restart: unless-stopped
ports: ports:
- "8000:8000" - "8080:8000"
environment: environment:
- DATABASE_URL=sqlite+aiosqlite:////data/school_management.db - DATABASE_URL=sqlite+aiosqlite:////data/school_management.db
- SECRET_KEY=${SECRET_KEY:-change-me-in-production-min-32-chars} - SECRET_KEY=${SECRET_KEY:-change-me-in-production-min-32-chars}
- CORS_ORIGINS=["http://localhost","http://localhost:80","http://localhost:3000"] - CORS_ORIGINS=["http://localhost:8081","http://localhost:8080","http://localhost:3000"]
- LOG_LEVEL=INFO - LOG_LEVEL=INFO
volumes: volumes:
- ./data:/data - ./data:/data
@@ -35,7 +35,7 @@ services:
container_name: notytex-frontend container_name: notytex-frontend
restart: unless-stopped restart: unless-stopped
ports: ports:
- "80:80" - "8081:80"
depends_on: depends_on:
- backend - backend
networks: networks: