Compare commits

..

No commits in common. "master" and "v3.0.1" have entirely different histories.

7 changed files with 17 additions and 47 deletions

View File

@ -72,8 +72,11 @@ Run the following command
* Standalone Mysql
```powershell
cd example
./mysql-init.sh && docker-compose -f standalone-mysql.yaml up
# Using mysql 5.7
docker-compose -f example/standalone-mysql-5.7.yaml up
# Using mysql 8
docker-compose -f example/standalone-mysql-8.yaml up
```
* Standalone Nacos Cluster

View File

@ -50,8 +50,11 @@
* Standalone Mysql
```powershell
cd example
./mysql-init.sh && docker-compose -f standalone-mysql.yaml up
# Using mysql 5.7
docker-compose -f example/standalone-mysql-5.7.yaml up
# Using mysql 8
docker-compose -f example/standalone-mysql-8.yaml up
```
* docker单节点部署集群模式

View File

@ -23,7 +23,7 @@ ENV MODE="cluster" \
TOMCAT_ACCESSLOG_ENABLED="false" \
TIME_ZONE="Asia/Shanghai"
ARG NACOS_VERSION=3.0.2
ARG NACOS_VERSION=3.0.1
ARG HOT_FIX_FLAG=""
WORKDIR $BASE_DIR
@ -46,5 +46,4 @@ RUN mkdir -p logs \
&& chmod +x bin/docker-startup.sh
EXPOSE 8848
EXPOSE 9848 8080
ENTRYPOINT ["sh","bin/docker-startup.sh"]

View File

@ -1,6 +1,6 @@
FROM amd64/buildpack-deps:buster-curl as installer
ARG NACOS_VERSION=3.0.2
ARG NACOS_VERSION=3.0.1
ARG HOT_FIX_FLAG=""
RUN set -x \
@ -45,5 +45,4 @@ RUN mkdir -p logs \
RUN chmod +x bin/docker-startup.sh
EXPOSE 8848
EXPOSE 9848 8080
ENTRYPOINT ["bin/docker-startup.sh"]

View File

@ -1 +1 @@
NACOS_VERSION=v3.0.2
NACOS_VERSION=v3.0.1

View File

@ -1,33 +0,0 @@
#!/bin/bash
set -e
# 加载 NACOS_VERSION
source .env
CLEAN_VERSION=${NACOS_VERSION#v}
SCHEMA_URL="https://raw.githubusercontent.com/alibaba/nacos/${CLEAN_VERSION}/distribution/conf/mysql-schema.sql"
TARGET_DIR="./mysql-init"
VERSIONED_FILE="${TARGET_DIR}/${NACOS_VERSION}-mysql-schema.sql"
FINAL_FILE="${TARGET_DIR}/mysql-schema.sql"
# 创建目录
mkdir -p "${TARGET_DIR}"
# 下载 schema 文件
echo "⬇️ Downloading MySQL schema for Nacos ${CLEAN_VERSION}..."
curl -sSL "$SCHEMA_URL" -o "${VERSIONED_FILE}"
# 校验下载
if [ ! -s "${VERSIONED_FILE}" ]; then
echo "❌ Failed to download schema file from $SCHEMA_URL"
exit 1
fi
# 拷贝为标准文件名供 MySQL 初始化使用
cp "${VERSIONED_FILE}" "${FINAL_FILE}"
# 删除原始版本号文件
rm -f "${VERSIONED_FILE}"
echo "✅ Downloaded and prepared: ${FINAL_FILE}"

View File

@ -17,15 +17,14 @@ services:
restart: always
mysql:
container_name: mysql
image: mysql:8.0.30
build:
context: .
dockerfile: ./image/mysql/8/Dockerfile
image: example/mysql:8.0.30
env_file:
- ../env/mysql.env
volumes:
- ./mysql:/var/lib/mysql
- ./mysql-init:/docker-entrypoint-initdb.d/
command:
--character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
ports:
- "3306:3306"
healthcheck: