From 9f20f6ecea846ef4017781cf568105d39618c4f6 Mon Sep 17 00:00:00 2001 From: Rastus01 Date: Sat, 30 May 2026 19:44:29 +0200 Subject: [PATCH] Add Docker deployment files --- .dockerignore | 4 ++++ Dockerfile | 10 +++++++++ README.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++-- nginx.conf | 36 ++++++++++++++++++++++++++++++ 4 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 nginx.conf diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7ac17fd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.git +.agents +.codex +README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fab7e78 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM nginx:1.27-alpine + +COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY index.html style.css script.js /usr/share/nginx/html/ +COPY .well-known /usr/share/nginx/html/.well-known + +EXPOSE 80 + +HEALTHCHECK --interval=30s --timeout=3s \ + CMD wget -q --spider http://127.0.0.1/ || exit 1 diff --git a/README.md b/README.md index 1d415e3..b882990 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,60 @@ -# Website +# rastus01.com -Just a website for my Server \ No newline at end of file +Statische persoenliche Landingpage fuer `rastus01.com`. + +Die Seite dient aktuell als einfache Selfhosting-Startseite und stellt die +Matrix-Discovery-Dateien unter `.well-known/matrix/` bereit. + +## Inhalt + +- Dunkle, responsive Landingpage ohne externe Frameworks +- Klassische statische Dateien: `index.html`, `style.css`, `script.js` +- Matrix Homeserver Discovery: + - `/.well-known/matrix/server` + - `/.well-known/matrix/client` +- Dockerfile fuer eine einfache Nginx-Auslieferung + +## Matrix + +`/.well-known/matrix/server` + +```json +{"m.server":"matrix.rastus01.com:443"} +``` + +`/.well-known/matrix/client` + +```json +{"m.homeserver":{"base_url":"https://matrix.rastus01.com"}} +``` + +Wichtig: Diese Dateien haben absichtlich keine `.json`-Dateiendung. + +## Lokal mit Docker + +Image bauen: + +```sh +docker build -t rastus01-static-site . +``` + +Container starten: + +```sh +docker run --rm -p 8080:80 rastus01-static-site +``` + +Danach ist die Seite unter `http://localhost:8080` erreichbar. + +## Coolify + +Das Repository kann in Coolify als Dockerfile-basierter Service deployed +werden. + +- Build-Methode: Dockerfile +- Exposed Port: `80` +- Kein Build-Command noetig +- Kein Start-Command noetig + +Die `nginx.conf` setzt fuer die Matrix `.well-known`-Dateien den Content-Type +`application/json` und CORS-Header. diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..3800f5c --- /dev/null +++ b/nginx.conf @@ -0,0 +1,36 @@ +server { + listen 80; + server_name _; + + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ =404; + } + + location = /.well-known/matrix/server { + default_type application/json; + add_header Access-Control-Allow-Origin "*" always; + try_files $uri =404; + } + + location = /.well-known/matrix/client { + default_type application/json; + add_header Access-Control-Allow-Origin "*" always; + add_header Access-Control-Allow-Methods "GET, OPTIONS" always; + add_header Access-Control-Allow-Headers "Content-Type" always; + + if ($request_method = OPTIONS) { + return 204; + } + + try_files $uri =404; + } + + location ~* \.(?:css|js|ico|png|jpg|jpeg|gif|webp|svg)$ { + expires 7d; + add_header Cache-Control "public, max-age=604800" always; + try_files $uri =404; + } +}