From 075a0f9f79f8c70e04fb6f16e372436273e62d23 Mon Sep 17 00:00:00 2001 From: Bert Hausmans Date: Tue, 6 Jan 2026 02:21:23 +0100 Subject: [PATCH] Add container registry workflow with build script --- docker-compose.prod.yml | 9 ++------- scripts/build-and-push.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 7 deletions(-) create mode 100755 scripts/build-and-push.sh diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 6a3acd2..30fc772 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -1,16 +1,11 @@ version: '3.8' # Productie configuratie voor Dockge deployment -# Kopieer deze YAML naar Dockge bij het aanmaken van een nieuwe stack -# De container wordt automatisch gebouwd vanuit de Gitea repository +# Gebruik de image van Gitea Container Registry services: questionnaire: - build: - context: http://10.0.10.205:3000/bert.hausmans/questionnaire.git#main - args: - # Wijzig deze datum om een rebuild te forceren - BUILD_DATE: "2026-01-06" + image: 10.0.10.205:3000/bert.hausmans/questionnaire:latest container_name: questionnaire ports: - "4000:4000" diff --git a/scripts/build-and-push.sh b/scripts/build-and-push.sh new file mode 100755 index 0000000..be2271f --- /dev/null +++ b/scripts/build-and-push.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Build and push Docker image to Gitea Container Registry +# Gebruik: ./scripts/build-and-push.sh [tag] +# Voorbeeld: ./scripts/build-and-push.sh latest +# ./scripts/build-and-push.sh v1.0.0 + +set -e + +# Configuratie +REGISTRY="10.0.10.205:3000" +IMAGE_NAME="bert.hausmans/questionnaire" +TAG="${1:-latest}" + +FULL_IMAGE="${REGISTRY}/${IMAGE_NAME}:${TAG}" + +echo "🔨 Building image: ${FULL_IMAGE}" +docker build -t "${FULL_IMAGE}" . + +echo "📤 Pushing image to registry..." +docker push "${FULL_IMAGE}" + +echo "✅ Done! Image pushed: ${FULL_IMAGE}" +echo "" +echo "📋 In Dockge: klik op 'Update' om de nieuwe image te pullen" +