ppteesr / build.sh
barryle
test
4f4fbc7
#!/bin/bash
# Get the value of NODE_NAME environment variable
custom_node_name="$NODE_NAME"
# Check if NODE_NAME is set
if [ -z "$custom_node_name" ]; then
echo "Error: NODE_NAME environment variable is not set."
exit 1
fi
# Build Docker image with the custom node name
docker build --build-arg NODE_NAME="$custom_node_name" -t my-node-app:v1 . && docker run -d -p 7860:7860 --name my_node_"$custom_node_name" my-node-app:v1