Files
strudel-docker/build.sh
2025-09-17 18:30:27 +01:00

30 lines
1021 B
Bash

#!/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"