Update environment configuration for PostgreSQL: Add new environment variables for NextAuth and PostgreSQL settings in .env file, update docker-compose.yml to utilize these variables, and enhance README documentation for environment setup. Ensure DATABASE_URL is constructed dynamically if not defined.
This commit is contained in:
@@ -24,17 +24,36 @@ docker-compose logs -f
|
||||
|
||||
## Variables d'environnement
|
||||
|
||||
Créez un fichier `.env` à la racine du projet avec les variables suivantes :
|
||||
Créez un fichier `.env` à la racine du projet à partir du template `.env.example` :
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
Puis modifiez les valeurs dans `.env` selon votre configuration :
|
||||
|
||||
```env
|
||||
# NextAuth Configuration
|
||||
NEXTAUTH_SECRET=your-secret-key-here
|
||||
NEXTAUTH_URL=http://localhost:3000
|
||||
|
||||
# PostgreSQL Configuration
|
||||
POSTGRES_USER=gotgaming
|
||||
POSTGRES_PASSWORD=change-this-in-production
|
||||
POSTGRES_DB=gotgaming
|
||||
DATABASE_URL=postgresql://gotgaming:change-this-in-production@got-postgres:5432/gotgaming?schema=public
|
||||
|
||||
# Database URL (optionnel - construite automatiquement si non définie)
|
||||
# DATABASE_URL=postgresql://gotgaming:change-this-in-production@got-postgres:5432/gotgaming?schema=public
|
||||
|
||||
# Docker Volumes (optionnel)
|
||||
POSTGRES_DATA_PATH=./data/postgres
|
||||
UPLOADS_PATH=./public/uploads
|
||||
```
|
||||
|
||||
**Important** :
|
||||
- Le fichier `.env` est ignoré par Git (ne pas commiter vos secrets)
|
||||
- Si vous changez `POSTGRES_PASSWORD` après la première initialisation, vous devrez soit réinitialiser la base, soit changer le mot de passe manuellement dans PostgreSQL
|
||||
|
||||
## Volumes persistants
|
||||
|
||||
### Base de données PostgreSQL
|
||||
|
||||
Reference in New Issue
Block a user