ame-job-manager/entrypoint.sh

38 lines
1 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
set -e
echo "=== AME Remote Job Manager — Entrypoint ==="
# Mount points from docker-compose.yml bind-mounts
SMB_SHARE="/smb-share"
WATCH_DIR="/watch"
OUTPUT_DIR="/output"
LOGS_DIR="/ame-logs"
# Check if SMB share is mounted
if [ ! -d "$SMB_SHARE" ]; then
echo "⚠ SMB share not mounted at $SMB_SHARE"
echo " Ensure the host has mounted: sudo mount -t cifs //172.18.210.5/ame /mnt/smb-ame"
mkdir -p "$WATCH_DIR" "$OUTPUT_DIR" "$LOGS_DIR"
echo "Created fallback local directories"
else
echo "✓ SMB share mounted at $SMB_SHARE"
# Create subdirectories if they don't exist
mkdir -p "$SMB_SHARE/watch" "$SMB_SHARE/output" "$SMB_SHARE/logs"
echo "✓ Subdirectories ready"
fi
# Verify paths are accessible (docker-compose handles the bind-mounts)
echo "Verifying mount points..."
for dir in "$WATCH_DIR" "$OUTPUT_DIR" "$LOGS_DIR"; do
if [ -d "$dir" ]; then
echo "$dir is accessible"
else
echo "$dir not accessible"
fi
done
echo "Starting Node.js application..."
exec node server.js