Files
moonwell-core/start-server.sh
T

80 lines
1.6 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ENV_FILE="${ENV_FILE:-$ROOT_DIR/.env}"
BUILD_FLAG="--build"
FOLLOW_LOGS=0
if [[ -f "$ENV_FILE" ]]; then
set -a
# shellcheck disable=SC1090
source "$ENV_FILE"
set +a
fi
usage() {
cat <<EOF
Usage: $(basename "$0") [--no-build] [--logs]
Starts the AzerothCore docker stack for this repository.
Options:
--no-build Start containers without rebuilding images
--logs Follow auth/world logs after startup
-h, --help Show this help
EOF
}
log() {
printf '[start-server] %s\n' "$*"
}
while (($#)); do
case "$1" in
--no-build)
BUILD_FLAG=""
;;
--logs)
FOLLOW_LOGS=1
;;
-h|--help)
usage
exit 0
;;
*)
printf 'Unknown option: %s\n\n' "$1" >&2
usage >&2
exit 1
;;
esac
shift
done
cd "$ROOT_DIR"
log "applying module configuration"
"$ROOT_DIR/setup-modules.sh"
log "starting docker services"
if [[ -n "$BUILD_FLAG" ]]; then
docker compose up -d --build
else
docker compose up -d
fi
log "current service status"
docker compose ps
printf '\n'
printf 'World: 127.0.0.1:%s\n' "${DOCKER_WORLD_EXTERNAL_PORT:-8085}"
printf 'Auth: 127.0.0.1:%s\n' "${DOCKER_AUTH_EXTERNAL_PORT:-3724}"
printf 'SOAP: 127.0.0.1:%s\n' "${DOCKER_SOAP_EXTERNAL_PORT:-7878}"
printf 'Account: ./create-account.sh admin your_password\n'
printf 'Logs: docker compose logs -f ac-worldserver ac-authserver\n'
if (( FOLLOW_LOGS )); then
docker compose logs -f ac-worldserver ac-authserver
fi