From 822c7781fd03abb99cd2ba418545f1a212837a31 Mon Sep 17 00:00:00 2001 From: ra_ma Date: Wed, 17 Sep 2025 18:30:27 +0100 Subject: [PATCH] build script --- build.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 build.sh diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..bcf1ae9 --- /dev/null +++ b/build.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Variables - customize these +REPO_URL="https://codeberg.org/uzu/strudel.git" +CLONE_DIR="strudel" +IMAGE_NAME="strudel_custom" +DOCKERFILE_PATH="Dockerfile_production" # Path to your custom Dockerfile, adjust if needed + +# Clone the repo (or update if it already exists) +if [ -d "$CLONE_DIR" ]; then + echo "Directory $CLONE_DIR already exists, pulling latest changes..." + cd "$CLONE_DIR" || exit 1 + git pull origin main || echo "Failed to pull updates" + cd .. +else + echo "Cloning Strudel repo from Codeberg..." + git clone "$REPO_URL" "$CLONE_DIR" || { echo "Git clone failed"; exit 1; } +fi + +# Copy custom Dockerfile into the repo +echo "Copying custom Dockerfile..." +cp "$DOCKERFILE_PATH" "$CLONE_DIR/Dockerfile" + +# Build the image using podman +echo "Building container image with podman..." +podman build -t "$IMAGE_NAME" -f "$CLONE_DIR/Dockerfile" "$CLONE_DIR" || { echo "Build failed"; exit 1; } + +echo "Build complete. Image tagged as: $IMAGE_NAME" +echo "Run with: podman run -d -p 8080:80 $IMAGE_NAME"