2.9 KiB
Executable File
2.9 KiB
Executable File
Quartz Setup auf dem Server
Übersicht
Diese Anleitung beschreibt, wie Sie Quartz als separate Instanz auf Port 3033 auf Ihrem Server einrichten.
Optionen für Quartz-Instanz
Option 1: Quartz direkt auf dem Host (Empfohlen)
Quartz läuft direkt auf dem Server-Host auf Port 3033:
# Quartz starten
cd /path/to/quartz
npx quartz build
npx serve -s public -l 3033
Konfiguration: NEXT_PUBLIC_WIKI_URL=http://localhost:3033
Option 2: Quartz in separatem Docker-Container
Quartz läuft in einem eigenen Container:
# docker-compose.wiki.yml
services:
quartz:
image: your-quartz-image
ports:
- "3033:3033"
volumes:
- ./wiki-vault:/app/content
- ./wiki-public:/app/public
Konfiguration:
- Für Browser (iframe):
NEXT_PUBLIC_WIKI_URL=http://localhost:3033 - Falls Next.js-Container zugreift:
NEXT_PUBLIC_WIKI_URL=http://host.docker.internal:3033
Option 3: Quartz im Docker-Netzwerk
Beide Container im gleichen Netzwerk:
# Netzwerk erstellen
docker network create wiki-network
# Next.js Container
docker-compose up -d
docker network connect wiki-network doing-it-web-1
# Quartz Container
docker run -d --name quartz --network wiki-network -p 3033:3033 your-quartz-image
Konfiguration: NEXT_PUBLIC_WIKI_URL=http://quartz:3033
Wichtiger Hinweis
Da das iframe client-side im Browser läuft (nicht im Container), verwendet es die URL so wie sie gesetzt ist:
localhost:3033funktioniert, wenn Quartz auf dem Host läufthost.docker.internal:3033funktioniert nur von einem Container aus, NICHT vom Browser- Für Browser muss die öffentliche URL verwendet werden (z.B.
http://doing-it.de:3033oder über Reverse Proxy)
Reverse Proxy Setup (Empfohlen für Produktion)
Mit Nginx
server {
listen 80;
server_name wiki.doing-it.de;
location / {
proxy_pass http://localhost:3033;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Dann: NEXT_PUBLIC_WIKI_URL=http://wiki.doing-it.de
Oder Subpath
server {
listen 80;
server_name doing-it.de;
location /wiki-content/ {
proxy_pass http://localhost:3033/;
}
}
Environment-Variable setzen
In docker-compose.yml (bereits konfiguriert)
environment:
- NEXT_PUBLIC_WIKI_URL=${NEXT_PUBLIC_WIKI_URL:-http://localhost:3033}
In .env Datei
NEXT_PUBLIC_WIKI_URL=http://localhost:3033
Bei Container-Start
NEXT_PUBLIC_WIKI_URL=http://localhost:3033 docker-compose up -d
Testing
- Quartz starten auf Port 3033
- Prüfen:
curl http://localhost:3033 - Next.js starten
- Wiki-Seite öffnen:
http://localhost:3001/wiki - Browser-Entwicklertools (F12) öffnen und prüfen, ob iframe geladen wird