Add Docker deployment files

This commit is contained in:
Moritz Klein 2026-05-30 19:44:29 +02:00
parent dbf0601e96
commit 9f20f6ecea
4 changed files with 109 additions and 2 deletions

4
.dockerignore Normal file
View file

@ -0,0 +1,4 @@
.git
.agents
.codex
README.md

10
Dockerfile Normal file
View file

@ -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

View file

@ -1,3 +1,60 @@
# Website
# rastus01.com
Just a website for my Server
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.

36
nginx.conf Normal file
View file

@ -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;
}
}