Noch ein paar Hardening-Sachen

This commit is contained in:
2025-09-25 14:08:45 +00:00
parent 744488fb5b
commit da9d08c149
4 changed files with 80 additions and 67 deletions

View File

@@ -9,7 +9,6 @@ Dieses Repository enthält zwei Welten: den modernen Node.js / React Stack sowie
| mysql | default | 3307 -> 3306 | MySQL 8 Datenbank |
| backend | default | 3001 -> 3001 | Node.js API (Express + Prisma) |
| frontend | default | 3000 -> 80 | React Build via nginx |
| php-app | legacy | 8082 -> 80 | Altes PHP Frontend |
| phpmyadmin | admin | 8083 -> 80 | DB Verwaltung |
## Node / Modern Stack
@@ -30,23 +29,12 @@ docker compose up -d
```
Öffnen: http://localhost:3000
### Mit Legacy PHP zusätzlich
```bash
docker compose --profile legacy up -d
```
Öffnen: http://localhost:8082
### Mit phpMyAdmin zusätzlich
### Mit phpMyAdmin
```bash
docker compose --profile admin up -d
```
Öffnen: http://localhost:8083
### Beide Zusatz-Profile
```bash
docker compose --profile legacy --profile admin up -d
```
### Alles stoppen
```bash
docker compose down
@@ -79,6 +67,25 @@ Danach Backend neu bauen.
## Datenbankzugang
## Environment (.env)
Beispiel siehe `.env.example`. Wichtigste Variablen:
```
DOMAIN=example.com
MYSQL_DATABASE=rezepte
MYSQL_USER=rezepte_user
MYSQL_PASSWORD=change_this_password
MYSQL_ROOT_PASSWORD=change_this_root_password
BACKEND_PORT=3001
FRONTEND_PORT=3000
DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@mysql:3306/${MYSQL_DATABASE}
JWT_SECRET=please_change_to_secure_32_char_min
CORS_ORIGIN=http://localhost:3000
VITE_API_URL=http://localhost:3001/api
UPLOAD_PATH=/app/uploads
MAX_FILE_SIZE=5242880
```
Nicht gesetzte Variablen fallen auf sichere Defaults (oder Dummy Werte) zurück; vor Produktion immer mit echten Secrets überschreiben.
## Datenbankzugang
### Für die Anwendung: