feat: Add Docker and Gitea Action deployment configuration

This commit is contained in:
Johannes Baumeister 2026-04-01 12:30:42 +02:00
parent cdbb6d5658
commit 12ef6f1cb6
3 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,20 @@
name: Deploy to Production (BW Samern Ohne)
on:
push:
branches:
- main
jobs:
build-and-deploy:
# Wichtig: Ändern Sie 'ubuntu-latest', falls Ihr act_runner lokale Labels wie 'linux' oder 'debian' verwendet
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Rebuild & Restart Container
run: |
# Bringe den Container hoch (ohne Downtime, wenn moeglich) oder baue ihn neu
docker compose up -d --build --force-recreate

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM nginx:alpine
# Entferne die Standard NGINX HTML Seite
RUN rm -rf /usr/share/nginx/html/*
# Kopiere alle statischen Projektdateien in das NGINX HTML-Verzeichnis
COPY . /usr/share/nginx/html/
# Expose Port 80
EXPOSE 80

26
docker-compose.yml Normal file
View File

@ -0,0 +1,26 @@
services:
bw-samern-ohne:
build: .
container_name: bw-samern-ohne
restart: always
networks:
- proxy-network
labels:
# Aktivierung in Traefik
- "traefik.enable=true"
# Generelle Router-Konfiguration fuer die Domain
- "traefik.http.routers.bw-samern-ohne.rule=Host(`bw-samern-ohne.enwelo-serverumgebung.cloud`)"
- "traefik.http.routers.bw-samern-ohne.entrypoints=websecure"
- "traefik.http.routers.bw-samern-ohne.tls.certresolver=letsencrypt"
# Zuweisung des Service-Ports
- "traefik.http.services.bw-samern-ohne.loadbalancer.server.port=80"
# === Authentik Forward-Auth Middleware ===
# (Setzt voraus, dass die Middleware "authentik" bereits global in Traefik oder einem anderen docker-compose deklariert ist)
- "traefik.http.routers.bw-samern-ohne.middlewares=authentik@docker"
networks:
proxy-network:
external: true