From 58522f2ae038d0fded87e3848851df1f364343bf Mon Sep 17 00:00:00 2001 From: Kenzo Date: Tue, 15 Jul 2025 21:08:24 +0200 Subject: [PATCH] Add deployment pipeline with Fly.io setup - Introduced `.woodpecker.yml` for CI/CD pipeline configuration targeting `main` branch. - Added `fly.toml` for Fly.io deployment settings, including region and deployment checks. - Created a `Dockerfile` for serving static files via NGINX with SPA routing setup. --- .woodpecker.yml | 11 +++++++++++ Dockerfile | 18 ++++++++++++++++++ fly.toml | 23 +++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 .woodpecker.yml create mode 100644 Dockerfile create mode 100644 fly.toml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..f9a3c7a --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,11 @@ +pipeline: + deploy: + image: node:20 + commands: + - curl -L https://fly.io/install.sh | sh + - export PATH="$HOME/.fly/bin:$PATH" + - flyctl deploy --config fly.toml --app gallus-pub + when: + event: push + branch: + - main diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7b4edb1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM nginx:alpine + +# Kopiere statische Dateien ins Nginx-Verzeichnis +COPY src/ /usr/share/nginx/html/ + +# Konfiguriere NGINX für Single-Page-Applications (optional) +RUN echo 'server { \ + listen 80; \ + root /usr/share/nginx/html; \ + index index.html; \ + location / { \ + try_files $uri $uri/ /index.html; \ + } \ +}' > /etc/nginx/conf.d/default.conf + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/fly.toml b/fly.toml new file mode 100644 index 0000000..0252565 --- /dev/null +++ b/fly.toml @@ -0,0 +1,23 @@ +app = "gallus-pub" +primary_region = "fra" + +[build] +dockerfile = "Dockerfile" # Da du mit einem Dockerfile arbeitest + +[http_service] + internal_port = 80 + force_https = true + auto_stop_machines = true + auto_start_machines = true + min_machines_running = 0 + processes = ["app"] + + [[http_service.checks]] + interval = "10s" + timeout = "2s" + grace_period = "5s" + method = "GET" + path = "/" + +[experimental] + auto_rollback = true