-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-db.sh
More file actions
36 lines (29 loc) · 961 Bytes
/
Copy pathrun-db.sh
File metadata and controls
36 lines (29 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# Script to build and run MySQL database container
# Usage: ./run-db.sh
set -e
CONTAINER_NAME="agent_platform_mysql"
IMAGE_NAME="agent-platform-mysql"
echo "🔨 Building MySQL image..."
docker build -t $IMAGE_NAME .
echo "Stopping existing container (if exists)..."
docker stop $CONTAINER_NAME 2>/dev/null || true
docker rm $CONTAINER_NAME 2>/dev/null || true
echo "Starting MySQL container..."
docker run -d \
--name $CONTAINER_NAME \
-p 3306:3306 \
-v mysql_data:/var/lib/mysql \
$IMAGE_NAME
echo "MySQL container started!"
echo ""
echo "Container name: $CONTAINER_NAME"
echo "Port: 3306"
echo "Root password: password"
echo "Database: agent_platform"
echo ""
echo "Useful commands:"
echo " docker stop $CONTAINER_NAME - Stop the container"
echo " docker start $CONTAINER_NAME - Start the container"
echo " docker logs $CONTAINER_NAME - View logs"
echo " docker rm $CONTAINER_NAME - Remove container (after stop)"