From e2058107a4f2237355c1b69c637d2a70d81ef261 Mon Sep 17 00:00:00 2001 From: quotschmacher Date: Thu, 15 Jan 2026 01:01:01 +0100 Subject: [PATCH 1/3] Added working docker scenario --- .dockerignore | 9 +++++++++ Dockerfile | 20 ++++++++++++++++++++ docker-compose.yml | 17 +++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..bd53acf --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +node_modules +.git +.github +*.md +.gitignore +.editorconfig +package*.json +scripts +CLAUDE.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7622e27 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Multi-stage build für minimales Image +FROM nginx:alpine + +# Statische Dateien kopieren +COPY index.html /usr/share/nginx/html/ + +# Nginx Konfiguration für SPA (falls nötig) +RUN echo 'server { \ + listen 80; \ + server_name _; \ + 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;"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4b4383d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +version: '3.8' + +services: + asn-qr-label-generator: + build: + context: . + dockerfile: Dockerfile + container_name: asn-qr-label-generator + ports: + - "8080:80" + restart: unless-stopped + healthcheck: + test: ["CMD", "wget", "--spider", "--quiet", "http://localhost/"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s From 8db8659664dd220c8ca956130ace57928f45a792 Mon Sep 17 00:00:00 2001 From: quotschmacher Date: Thu, 15 Jan 2026 01:07:27 +0100 Subject: [PATCH 2/3] Added workflow for image publishing --- .github/workflows/docker-image.yml | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..ce1edf0 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,41 @@ +name: Build and Publish Docker Image + +on: + workflow_dispatch: + +permissions: + contents: read + packages: write + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout main + uses: actions/checkout@v6 + with: + ref: main + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Resolve short SHA + id: vars + run: echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: | + ghcr.io/${{ github.repository }}:latest + ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.sha_short }} From 9a3fb5d3ba4fd381dd660655dae6fb20f6c30e1e Mon Sep 17 00:00:00 2001 From: quotschmacher Date: Thu, 15 Jan 2026 01:23:56 +0100 Subject: [PATCH 3/3] Optimized health check --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4b4383d..c7ae4f4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,8 +10,8 @@ services: - "8080:80" restart: unless-stopped healthcheck: - test: ["CMD", "wget", "--spider", "--quiet", "http://localhost/"] + test: ["CMD-SHELL", "wget --spider --quiet http://127.0.0.1:80/ || exit 1"] interval: 30s timeout: 10s retries: 3 - start_period: 5s + start_period: 20s