94 lines
2.1 KiB
Markdown
94 lines
2.1 KiB
Markdown
# Flutter Tank Web App - Docker Deployment
|
|
|
|
Dieser Ordner enthält alle notwendigen Dateien für das Docker-Deployment der Flutter Tank Web App.
|
|
|
|
## 📋 Voraussetzungen
|
|
|
|
- Docker muss auf dem Server installiert sein
|
|
- Port 8888 muss verfügbar sein
|
|
|
|
## 🚀 Deployment
|
|
|
|
### 1. Ordner auf Server kopieren
|
|
|
|
Kopieren Sie den kompletten `webserver` Ordner auf Ihren Server:
|
|
|
|
```bash
|
|
scp -r webserver user@your-server:/path/to/destination/
|
|
```
|
|
|
|
### 2. In den installDocker Ordner wechseln
|
|
|
|
```bash
|
|
cd /path/to/destination/webserver/installDocker
|
|
```
|
|
|
|
### 3. Deployment ausführen
|
|
|
|
```bash
|
|
./deploy.sh
|
|
```
|
|
|
|
Das Script führt automatisch folgende Schritte aus:
|
|
- Stoppt und entfernt bestehende Container
|
|
- Baut das Docker Image
|
|
- Startet den Container auf Port 8888
|
|
- Zeigt den Status an
|
|
|
|
## 🌐 Zugriff
|
|
|
|
Nach erfolgreichem Deployment ist die App erreichbar unter:
|
|
- **Web App:** `http://your-server:8888`
|
|
- **Health Check:** `http://your-server:8888/health`
|
|
|
|
## 🔧 Nützliche Befehle
|
|
|
|
```bash
|
|
# Logs anzeigen
|
|
docker logs flutter-tank-web-container
|
|
|
|
# Logs live verfolgen
|
|
docker logs -f flutter-tank-web-container
|
|
|
|
# Container stoppen
|
|
docker stop flutter-tank-web-container
|
|
|
|
# Container neustarten
|
|
docker restart flutter-tank-web-container
|
|
|
|
# Container und Image entfernen
|
|
docker stop flutter-tank-web-container
|
|
docker rm flutter-tank-web-container
|
|
docker rmi flutter-tank-web
|
|
```
|
|
|
|
## 📁 Dateien
|
|
|
|
- **Dockerfile** - Docker Image Definition (nginx:alpine mit Flutter Web Build)
|
|
- **nginx.conf** - Nginx Konfiguration mit Gzip, Caching und Flutter Routing
|
|
- **deploy.sh** - Automatisches Deployment-Script
|
|
- **README.md** - Diese Dokumentation
|
|
|
|
## 🔒 Sicherheit
|
|
|
|
Die nginx.conf enthält bereits:
|
|
- Security Headers (X-Frame-Options, X-Content-Type-Options, X-XSS-Protection)
|
|
- Gzip Kompression für bessere Performance
|
|
- Caching für statische Assets (1 Jahr)
|
|
- Client-side Routing Support für Flutter
|
|
|
|
## 🐛 Troubleshooting
|
|
|
|
**Container startet nicht:**
|
|
```bash
|
|
docker logs flutter-tank-web-container
|
|
```
|
|
|
|
**Port bereits in Verwendung:**
|
|
Ändern Sie in `deploy.sh` die Variable `PORT=8888` auf einen anderen Port.
|
|
|
|
**Berechtigungsprobleme:**
|
|
```bash
|
|
chmod +x deploy.sh
|
|
```
|