feat: Add Docker and Gitea Action deployment configuration
This commit is contained in:
parent
cdbb6d5658
commit
12ef6f1cb6
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
Loading…
Reference in New Issue