cleanup unused or orphaned files (#9)
* changed vue.instructions to be used for *.vue, *.ts, *.js, *.scss * remove unneeded files or files that may conflict with some peoples' protection meanings * ToDos as the popped up during cleaning
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
# =========== 1) Build stage ===========
|
||||
FROM golang:1.24-alpine AS builder
|
||||
|
||||
# Create and set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy go.mod and go.sum first, then download dependencies
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
# Copy the rest of the backend code
|
||||
COPY . .
|
||||
|
||||
# Build the Go binary
|
||||
RUN go build -o server main.go
|
||||
|
||||
# =========== 2) Runtime stage ===========
|
||||
FROM alpine:3.18
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the compiled binary from builder stage
|
||||
COPY --from=builder /app/server /app
|
||||
|
||||
# Expose port 8180 (backend port)
|
||||
EXPOSE 8180
|
||||
|
||||
# Run the Go server
|
||||
CMD ["./server"]
|
||||
@@ -1,181 +0,0 @@
|
||||
# Bamort Development Environment
|
||||
|
||||
Diese Docker-Konfiguration ermöglicht es, die Bamort-Anwendung in einer Entwicklungsumgebung zu starten, in der Änderungen am Code sofort verfügbar sind.
|
||||
|
||||
## Voraussetzungen
|
||||
|
||||
- Docker und Docker Compose installiert
|
||||
- Ports 8080 (Backend) und 5173 (Frontend) verfügbar
|
||||
|
||||
## Starten der Entwicklungsumgebung
|
||||
|
||||
```bash
|
||||
# Aus dem docker/ Verzeichnis
|
||||
./start-dev.sh
|
||||
|
||||
# Oder manuell
|
||||
docker-compose -f docker-compose.dev.yml up --build
|
||||
|
||||
# Mit benutzerdefinierten Umgebungsvariablen
|
||||
cp .env.example .env.dev
|
||||
# Bearbeite .env.dev nach Bedbedarf
|
||||
docker-compose -f docker-compose.dev.yml --env-file .env.dev up --build
|
||||
```
|
||||
|
||||
## Stoppen der Entwicklungsumgebung
|
||||
|
||||
```bash
|
||||
# Aus dem docker/ Verzeichnis
|
||||
./stop-dev.sh
|
||||
|
||||
# Oder manuell
|
||||
docker-compose -f docker-compose.dev.yml down
|
||||
```
|
||||
|
||||
## Verfügbare Services
|
||||
|
||||
### MariaDB (Datenbankserver)
|
||||
- **Port**: 3306 (localhost:3306)
|
||||
- **Datenbank**: bamort
|
||||
- **Benutzer**: bamort
|
||||
- **Passwort**: bG4)efozrc (Development)
|
||||
- **Root-Passwort**: root_password_dev
|
||||
- **Persistent**: ✅ Daten bleiben bei Container-Neustarts erhalten
|
||||
- **Health Check**: ✅ Backend wartet auf Datenbankbereitschaft
|
||||
|
||||
### phpMyAdmin (Datenbank-Management)
|
||||
- **URL**: http://localhost:8082
|
||||
- **Server**: mariadb (automatisch konfiguriert)
|
||||
- **Login**: root / root_password_dev (oder bamort / bG4)efozrc)
|
||||
- **Features**: ✅ Web-basiertes Datenbank-Management
|
||||
- **Auto-Login**: ✅ Vorkonfiguriert für MariaDB-Container
|
||||
|
||||
### Backend (Go mit Air Live-Reloading)
|
||||
- **URL**: http://localhost:8180
|
||||
- **API-Dokumentation**: http://localhost:8180/api (falls verfügbar)
|
||||
- **Datenbankverbindung**: Automatisch konfiguriert zu MariaDB-Container
|
||||
- **Live-Reloading**: ✅ Änderungen an Go-Dateien lösen automatisch einen Neustart aus
|
||||
- **Volume**: Backend-Code wird vom lokalen Verzeichnis gemountet
|
||||
|
||||
### Frontend (Vue.js mit Vite Dev Server)
|
||||
- **URL**: http://localhost:5173
|
||||
- **Live-Reloading**: ✅ Änderungen an Vue-Dateien werden sofort übernommen
|
||||
- **Hot Module Replacement**: ✅ Aktiviert für schnelle Entwicklung
|
||||
- **Volume**: Frontend-Code wird vom lokalen Verzeichnis gemountet
|
||||
|
||||
## Entwicklung
|
||||
|
||||
### Backend-Entwicklung
|
||||
- Alle Änderungen an `.go` Dateien im `backend/` Verzeichnis werden automatisch erkannt
|
||||
- Der Server wird automatisch neu gestartet bei Änderungen
|
||||
- Logs sind in der Docker-Konsole sichtbar
|
||||
|
||||
### Frontend-Entwicklung
|
||||
- Alle Änderungen an Vue-Komponenten, CSS und anderen Assets werden sofort übernommen
|
||||
- Vite's Hot Module Replacement sorgt für schnelle Updates ohne vollständigen Page-Reload
|
||||
- Build-Fehler werden im Browser angezeigt
|
||||
|
||||
## Debugging
|
||||
|
||||
### Backend-Logs anzeigen
|
||||
```bash
|
||||
docker-compose -f docker-compose.dev.yml logs backend-dev
|
||||
```
|
||||
|
||||
### Frontend-Logs anzeigen
|
||||
```bash
|
||||
docker-compose -f docker-compose.dev.yml logs frontend-dev
|
||||
```
|
||||
|
||||
### In Container einsteigen
|
||||
```bash
|
||||
# MariaDB
|
||||
docker exec -it bamort-mariadb-dev mysql -u bamort -p bamort
|
||||
|
||||
# phpMyAdmin (Web-Interface)
|
||||
# Zugriff über Browser: http://localhost:8082
|
||||
|
||||
# Backend
|
||||
docker exec -it bamort-backend-dev sh
|
||||
|
||||
# Frontend
|
||||
docker exec -it bamort-frontend-dev sh
|
||||
```
|
||||
|
||||
## Datenbank-Management
|
||||
|
||||
### Web-Interface (phpMyAdmin)
|
||||
- **URL**: http://localhost:8082
|
||||
- **Login**:
|
||||
- Root: `root` / `root_password_dev`
|
||||
- User: `bamort` / `bG4)efozrc`
|
||||
- **Features**: Vollständige Datenbankverwaltung über Web-Interface
|
||||
|
||||
### Kommandozeilen-Zugriff
|
||||
```bash
|
||||
# Mit mysql client im Container
|
||||
docker exec -it bamort-mariadb-dev mysql -u bamort -p bamort
|
||||
|
||||
# Oder als root
|
||||
docker exec -it bamort-mariadb-dev mysql -u root -p
|
||||
```
|
||||
|
||||
### Backup/Restore
|
||||
```bash
|
||||
# Backup erstellen
|
||||
docker exec bamort-mariadb-dev mysqldump -u bamort -pbG4)efozrc bamort > backup.sql
|
||||
|
||||
# Backup einspielen
|
||||
docker exec -i bamort-mariadb-dev mysql -u bamort -pbG4)efozrc bamort < backup.sql
|
||||
```
|
||||
|
||||
### Datenbank zurücksetzen
|
||||
```bash
|
||||
# Volumes löschen (alle Daten gehen verloren!)
|
||||
docker-compose -f docker-compose.dev.yml down -v
|
||||
docker-compose -f docker-compose.dev.yml up --build
|
||||
```
|
||||
|
||||
## Konfiguration
|
||||
|
||||
### MariaDB
|
||||
- Version: 11.4
|
||||
- Charset: utf8mb4
|
||||
- Collation: utf8mb4_unicode_ci
|
||||
- Initialisierungsskripte: `docker/init-db/`
|
||||
|
||||
### Backend
|
||||
- Environment: `development`
|
||||
- Datenbanktyp: mysql (MariaDB)
|
||||
- Datenbankverbindung: Automatisch konfiguriert
|
||||
- Air-Konfiguration: `backend/.air.toml`
|
||||
- Ausgeschlossene Dateien: Tests, Uploads, temporäre Dateien
|
||||
|
||||
### Frontend
|
||||
- Environment: `development`
|
||||
- Vite dev server mit `--host 0.0.0.0` für Docker-Zugriff
|
||||
- API URL: `http://localhost:8080` (konfigurierbar über VITE_API_URL)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Port bereits in Verwendung
|
||||
Stelle sicher, dass die Ports 3306, 8080, 8082, 8180 und 5173 nicht von anderen Anwendungen verwendet werden.
|
||||
|
||||
### Datenbankverbindungsfehler
|
||||
- Warte nach dem Start 10-15 Sekunden, bis MariaDB vollständig initialisiert ist
|
||||
- Überprüfe die Logs: `docker-compose -f docker-compose.dev.yml logs mariadb`
|
||||
|
||||
### phpMyAdmin nicht erreichbar
|
||||
- Stelle sicher, dass Port 8082 frei ist
|
||||
- Warte bis MariaDB vollständig gestartet ist
|
||||
- Überprüfe die Logs: `docker-compose -f docker-compose.dev.yml logs phpmyadmin`
|
||||
|
||||
### Node_modules Probleme
|
||||
Falls es Probleme mit node_modules gibt:
|
||||
```bash
|
||||
docker-compose -f docker-compose.dev.yml down -v
|
||||
docker-compose -f docker-compose.dev.yml up --build
|
||||
```
|
||||
|
||||
### Go Modules Cache
|
||||
Der Go-Module-Cache wird in einem Volume gespeichert, um Downloads zu beschleunigen.
|
||||
@@ -13,9 +13,9 @@
|
||||
|
||||
| Service | URL | Credentials | Description |
|
||||
|---------|-----|-------------|-------------|
|
||||
| **Frontend** | http://localhost:5173 | - | Vue.js Application |
|
||||
| **Backend API** | http://localhost:8180 | - | Go REST API |
|
||||
| **MariaDB** | localhost:3306 | bamort/[ENV_VAR] | Direct Database Connection |
|
||||
| **Frontend** | http://frontend.domain | - | Vue.js Application |
|
||||
| **Backend API** | http://backend.domain | - | Go REST API |
|
||||
| **MariaDB** | mariadb:3306 Not exposed| bamort/[ENV_VAR] | Direct Database Connection |
|
||||
|
||||
> **Note**: phpMyAdmin is disabled in production by default. Uncomment the service in `docker-compose.yml` if needed (Port 8081).
|
||||
|
||||
@@ -88,9 +88,9 @@ docker exec -it bamort-mariadb-dev mysql -u bamort -p bamort
|
||||
|
||||
### Production
|
||||
- **3306**: MariaDB
|
||||
- **5173**: Vue.js Frontend
|
||||
- **443**: Vue.js Frontend
|
||||
- **8081**: phpMyAdmin (disabled by default)
|
||||
- **8180**: Go Backend API
|
||||
- **443**: Go Backend API
|
||||
|
||||
## Enabling phpMyAdmin in Production
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#FROM node:14
|
||||
FROM node:21.6-slim
|
||||
|
||||
RUN apt update; apt install -y curl
|
||||
|
||||
WORKDIR /vue-setup
|
||||
|
||||
RUN npm install -g @vue/cli
|
||||
RUN npm install -g vite
|
||||
|
||||
# The following commands ensure access to our files
|
||||
# If we left them out, changing files on our local setup
|
||||
# would fail due to insufficient permissions.
|
||||
RUN userdel -r node
|
||||
|
||||
ARG USER_ID
|
||||
|
||||
ARG GROUP_ID
|
||||
|
||||
RUN addgroup --gid $GROUP_ID user
|
||||
|
||||
RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user
|
||||
|
||||
# Set the active user and open the interactive terminal
|
||||
USER user
|
||||
|
||||
ENTRYPOINT [ "bash" ]
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
# Build an image named vue_helper using the Setup.Dockerfile
|
||||
# The build args manage permissions when executing commands from inside the container
|
||||
#
|
||||
docker build -f ./dockerfiles/Dev.Dockerfile -t vue_app:dev vue_app
|
||||
@@ -1,7 +0,0 @@
|
||||
# Build an image named vue_helper using the Setup.Dockerfile
|
||||
# The build args manage permissions when executing commands from inside the container
|
||||
#
|
||||
docker build \
|
||||
--build-arg USER_ID=$(id -u) \
|
||||
--build-arg GROUP_ID=$(id -g) \
|
||||
-t vue_helper:slim - < ./dockerfiles/Setup.Dockerfile
|
||||
@@ -1,3 +0,0 @@
|
||||
docker run -v /data/dev/bamort/bamort:/vue_app \
|
||||
-p 8080:8080 \
|
||||
-it vue_app:dev
|
||||
@@ -1 +0,0 @@
|
||||
docker run --rm -ti -v /data/dev/bamort:/vue-setup vue_helper:slim
|
||||
Reference in New Issue
Block a user