Full packaged app

- LFS (just incase)
- WS
- Room creation/destruction
- Dice Rolling functions
- Modifier added correctly
This commit is contained in:
riomoo 2025-10-20 10:01:43 -04:00
parent 0194875242
commit 47788a19f5
Signed by: riomoo
SSH key fingerprint: SHA256:dP5B5iLpXU5V8aBA8eGm9tN5YtxXJybnv4McyltPyzM
7 changed files with 852 additions and 0 deletions

41
run.sh Executable file
View file

@ -0,0 +1,41 @@
#!/bin/bash
# Define variables for your image and container name.
IMAGE_NAME="localhost/gofudge:latest"
CONTAINER_NAME="gofudge"
# Step 1: Build the new container image.
echo "Building new image: $IMAGE_NAME..."
podman build --force-rm -t "$IMAGE_NAME" .
# Check if the build was successful before proceeding.
if [ $? -ne 0 ]; then
echo "Image build failed. Exiting script."
exit 1
fi
# Step 2: Check if the container is already running.
if podman container exists "$CONTAINER_NAME"; then
echo "Container '$CONTAINER_NAME' already exists. Stopping and removing it..."
# Step 3: Stop the existing container.
podman stop "$CONTAINER_NAME"
# Step 4: Remove the stopped container.
podman rm "$CONTAINER_NAME"
fi
# Step 5: Run a new container from the newly built image.
echo "Starting new container from image: $IMAGE_NAME..."
podman run -d --name "$CONTAINER_NAME" --memory=75m --restart unless-stopped -p 12007:8080 "$IMAGE_NAME"
# Check if the new container started successfully.
if [ $? -ne 0 ]; then
echo "Failed to start new container. Exiting script."
exit 1
fi
# Step 6: Clean up old, unused images.
# This command removes any images that are not being used by a container.
echo "Cleaning up old images..."
podman image prune --force
echo "Update and cleanup complete!"