initial commit
This commit is contained in:
31
run-podman.sh
Executable file
31
run-podman.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# Script to build and run QR Code Generator with Podman
|
||||
|
||||
set -e
|
||||
|
||||
IMAGE_NAME="qr-code-generator"
|
||||
CONTAINER_NAME="qr-code-generator-app"
|
||||
PORT=8501
|
||||
|
||||
echo "Building QR Code Generator container..."
|
||||
podman build -t $IMAGE_NAME .
|
||||
|
||||
echo "Stopping existing container if running..."
|
||||
podman stop $CONTAINER_NAME 2>/dev/null || true
|
||||
podman rm $CONTAINER_NAME 2>/dev/null || true
|
||||
|
||||
echo "Starting QR Code Generator container..."
|
||||
podman run -d \
|
||||
--name $CONTAINER_NAME \
|
||||
-p $PORT:8501 \
|
||||
--restart unless-stopped \
|
||||
$IMAGE_NAME
|
||||
|
||||
echo "Container started successfully!"
|
||||
echo "Access the application at: http://localhost:$PORT"
|
||||
echo ""
|
||||
echo "Useful commands:"
|
||||
echo " podman logs $CONTAINER_NAME # View logs"
|
||||
echo " podman stop $CONTAINER_NAME # Stop container"
|
||||
echo " podman start $CONTAINER_NAME # Start container"
|
||||
echo " podman rm $CONTAINER_NAME # Remove container"
|
||||
Reference in New Issue
Block a user