feat: Add Docker support and health endpoint
- Add production-ready Dockerfile with multi-stage build - Add .dockerignore for optimized builds - Add docker-compose.yml for easy deployment - Add /health endpoint for container health checks - Update README with comprehensive Docker documentation - Include security best practices (non-root user, health checks) - Support for both development and production deployments
This commit is contained in:
75
README.md
75
README.md
@@ -75,6 +75,81 @@ pnpm install
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
## Docker Deployment
|
||||
|
||||
### Docker Build
|
||||
|
||||
```bash
|
||||
# Docker Image erstellen
|
||||
docker build -t stargirlnails-booking .
|
||||
|
||||
# Container starten
|
||||
docker run -d \
|
||||
--name stargirlnails-app \
|
||||
-p 3000:3000 \
|
||||
--env-file .env \
|
||||
stargirlnails-booking
|
||||
```
|
||||
|
||||
### Docker Compose (empfohlen)
|
||||
|
||||
Erstelle eine `docker-compose.yml` Datei:
|
||||
|
||||
```yaml
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
stargirlnails:
|
||||
build: .
|
||||
ports:
|
||||
- "3000:3000"
|
||||
env_file:
|
||||
- .env
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
```
|
||||
|
||||
Starten mit Docker Compose:
|
||||
|
||||
```bash
|
||||
# Container starten
|
||||
docker-compose up -d
|
||||
|
||||
# Logs anzeigen
|
||||
docker-compose logs -f
|
||||
|
||||
# Container stoppen
|
||||
docker-compose down
|
||||
```
|
||||
|
||||
### Produktions-Deployment
|
||||
|
||||
Für den produktiven Einsatz:
|
||||
|
||||
```bash
|
||||
# Mit Docker Compose
|
||||
docker-compose -f docker-compose.yml up -d
|
||||
|
||||
# Oder direkt mit Docker
|
||||
docker run -d \
|
||||
--name stargirlnails-prod \
|
||||
-p 80:3000 \
|
||||
--restart unless-stopped \
|
||||
--env-file .env.production \
|
||||
stargirlnails-booking
|
||||
```
|
||||
|
||||
**Wichtige Produktions-Hinweise:**
|
||||
- Verwende eine `.env.production` Datei mit Produktions-Konfiguration
|
||||
- Setze `NODE_ENV=production` in der Umgebungsdatei
|
||||
- Verwende einen Reverse Proxy (nginx, Traefik) für HTTPS
|
||||
- Überwache Container mit Health Checks
|
||||
|
||||
## Features
|
||||
|
||||
- 📅 **Terminbuchung**: Kunden können online Termine buchen
|
||||
|
Reference in New Issue
Block a user