post-install updates

This commit is contained in:
Deckard
2025-10-03 22:05:39 -04:00
parent 10e08f791a
commit b4a763a883
3 changed files with 85 additions and 6 deletions

View File

@@ -1106,6 +1106,7 @@ services:
- ${STORAGE_PATH}/config:/azerothcore/config
- ${STORAGE_PATH}/install-markers:/install-markers
- .:/project
- /var/run/docker.sock:/var/run/docker.sock:rw
working_dir: /project
environment:
MYSQL_HOST: ${CONTAINER_MYSQL}
@@ -1119,6 +1120,8 @@ services:
SERVER_ADDRESS: ${SERVER_ADDRESS}
REALM_PORT: ${REALM_PORT}
NETWORK_NAME: ${NETWORK_NAME}
CONTAINER_AUTHSERVER: ${CONTAINER_AUTHSERVER}
CONTAINER_WORLDSERVER: ${CONTAINER_WORLDSERVER}
depends_on:
- ac-modules
command:
@@ -1127,7 +1130,7 @@ services:
- |
# Install required packages
echo "📦 Installing required packages..."
apk add --no-cache bash curl
apk add --no-cache bash curl docker-cli
# Download post-install script from GitHub (fallback to local for testing)
echo "📥 Downloading auto post-install script..."

View File

@@ -18,6 +18,7 @@ This project is a Docker/Podman implementation based on:
- **Multi-Runtime Support**: Works with both Docker and Podman
- **Automated Database Initialization**: Complete schema import and setup automation
- **Comprehensive Health Checks**: Built-in service monitoring and restart policies
- **Automated Service Restart**: Post-install automatically restarts services with Docker/Podman support
- **Automated Backup System**: Scheduled backups with configurable retention
- **Production-Ready Security**: Advanced security configurations and best practices
@@ -69,6 +70,7 @@ This project provides a production-ready AzerothCore deployment using Docker/Pod
-**Fully Containerized**: All components run in isolated containers
-**Automated Setup**: Database creation, schema import, and configuration handled automatically
-**Auto-Restart Services**: Post-install automatically restarts authserver/worldserver (Docker/Podman compatible)
-**Playerbot Integration**: AI-controlled bots for solo/small group play
-**Eluna Support**: Lua scripting for custom content
-**Automated Backups**: Scheduled database backups with retention policies
@@ -379,10 +381,41 @@ docker logs ac-post-install -f
# 2. Wait for MySQL and configuration files to be ready
# 3. Update .conf files with production database settings
# 4. Update realmlist table with server address and port
# 5. Restart services to apply changes
# 5. Automatically restart authserver and worldserver to apply changes
# 6. Create a completion marker to prevent re-execution
```
#### Automatic Service Restart
The post-install system includes **automatic service restart functionality** with support for both Docker and Podman:
**Container Runtime Detection**:
- 🐳 **Docker**: Automatically detects Docker daemon and uses Docker CLI
- 🦭 **Podman**: Falls back to Podman CLI if Docker unavailable
- ⚠️ **Graceful fallback**: Skips restart if no runtime detected (continues other tasks)
**Restart Process**:
```bash
🔄 Restarting authserver and worldserver to pick up new configuration...
🐳 Detected Docker runtime
🔄 Restarting authserver container: ac-authserver
✅ Authserver restarted successfully
🔄 Restarting worldserver container: ac-worldserver
✅ Worldserver restarted successfully
✅ Service restart completed
```
**Requirements**:
- **Docker socket access**: Container has `/var/run/docker.sock` mounted
- **Container runtime**: Docker or Podman available in container
- **Environment variables**: `CONTAINER_AUTHSERVER` and `CONTAINER_WORLDSERVER` defined
**Benefits**:
- ✅ **Immediate effect**: Configuration changes applied instantly
- ✅ **No manual intervention**: Fully automated restart process
- ✅ **Cross-platform**: Works with Docker Desktop, Podman, and cloud environments
- ✅ **Graceful shutdown**: Services shut down cleanly before restart
#### Manual Post-Installation (Optional)
If you need to run post-installation manually or troubleshoot:

View File

@@ -104,12 +104,55 @@ else
exit 1
fi
# Step 3: Note about service restart
# Step 3: Restart services to apply changes
echo ""
echo " Step 3: Service restart note..."
echo " Step 3: Restarting services to apply changes..."
echo "📝 Configuration changes have been applied to files"
echo "💡 Services will automatically restart if needed during next deployment"
echo "✅ Post-install configuration completed - services will pick up changes on next restart"
echo "🔄 Restarting authserver and worldserver to pick up new configuration..."
# Detect container runtime (Docker or Podman)
CONTAINER_CMD=""
if command -v docker >/dev/null 2>&1; then
# Check if we can connect to Docker daemon
if docker version >/dev/null 2>&1; then
CONTAINER_CMD="docker"
echo "🐳 Detected Docker runtime"
fi
fi
if [ -z "$CONTAINER_CMD" ] && command -v podman >/dev/null 2>&1; then
# Check if we can connect to Podman
if podman version >/dev/null 2>&1; then
CONTAINER_CMD="podman"
echo "🦭 Detected Podman runtime"
fi
fi
if [ -z "$CONTAINER_CMD" ]; then
echo "⚠️ No container runtime detected (docker/podman) - skipping restart"
else
# Restart authserver
if [ -n "$CONTAINER_AUTHSERVER" ]; then
echo "🔄 Restarting authserver container: $CONTAINER_AUTHSERVER"
if $CONTAINER_CMD restart "$CONTAINER_AUTHSERVER" 2>/dev/null; then
echo "✅ Authserver restarted successfully"
else
echo "⚠️ Failed to restart authserver (may not be running yet)"
fi
fi
# Restart worldserver
if [ -n "$CONTAINER_WORLDSERVER" ]; then
echo "🔄 Restarting worldserver container: $CONTAINER_WORLDSERVER"
if $CONTAINER_CMD restart "$CONTAINER_WORLDSERVER" 2>/dev/null; then
echo "✅ Worldserver restarted successfully"
else
echo "⚠️ Failed to restart worldserver (may not be running yet)"
fi
fi
fi
echo "✅ Service restart completed"
# Create completion marker
echo "$(date)" > /install-markers/post-install-completed