Compare commits

..

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

9 changed files with 24 additions and 72 deletions

View File

@ -40,16 +40,13 @@ docker run --name nacos-quick -e MODE=standalone -p 8848:8848 -p 9848:9848 -d na
## Advanced Usage
* Tips: You can change [the version of the Nacos image](https://hub.docker.com/r/nacos/nacos-server/tags) in the compose
file from the following configuration.
* Tips: You can change [the version of the Nacos image](https://hub.docker.com/r/nacos/nacos-server/tags) in the compose file from the following configuration.
`example/.env`
```dotenv
NACOS_VERSION=v2.3.1
```
For Mac user with Arm Chip (like M1/M2/M3 series) , you need to add `-slim` after version which support `arm` arch.
For Mac user with Arm Chip (like M1/M2/M3 series) , you need to add `-slim` after version which support `arm` arch.
```dotenv
NACOS_VERSION=v2.3.1-slim
```
@ -72,8 +69,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
@ -151,13 +151,8 @@ Run the following command
| NACOS_SECURITY_IGNORE_URLS | nacos.security.ignore.urls | default : `/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**` |
| NACOS_CONSOLE_UI_ENABLED | nacos.console.ui.enabled | default : `true` |
| NACOS_CORE_PARAM_CHECK_ENABLED | nacos.core.param.check.enabled | default : `true` |
| DB_POOL_CONNECTION_TIMEOUT | Database connection pool timeout in milliseconds | default : **30000** |
| NACOS_CONSOLE_UI_ENABLED | nacos.console.ui.enabled | default : `true` |
| NACOS_CORE_PARAM_CHECK_ENABLED | nacos.core.param.check.enabled | default : `true` |
| NACOS_AUTH_ADMIN_ENABLE | nacos.core.auth.admin.enable | default : `true` |
| NACOS_AUTH_CONSOLE_ENABLE | nacos.core.auth.console.enable | default : `true` | |
| NACOS_CONSOLE_PORT | nacos.console.port | default : `8080` |
| NACOS_CONSOLE_CONTEXTPATH | nacos.console.contextPath | default : `` |
| DB_POOL_CONNECTION_TIMEOUT | Database connection pool timeout in milliseconds | default : **30000** |
## Advanced configuration

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单节点部署集群模式
@ -168,12 +171,10 @@
| NACOS_AUTH_IDENTITY_VALUE | nacos.core.auth.server.identity.value | `注意该环境变量在Nacos 2.2.1版本中已移除` |
| NACOS_SECURITY_IGNORE_URLS | nacos.security.ignore.urls | default : `/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**` |
| DB_POOL_CONNECTION_TIMEOUT | 数据库连接池超时时间,单位为毫秒 | 默认 : **30000** |
| NACOS_CONSOLE_UI_ENABLED | nacos.console.ui.enabled | default : `true` |
| NACOS_CORE_PARAM_CHECK_ENABLED | nacos.core.param.check.enabled | default : `true` |
| NACOS_AUTH_ADMIN_ENABLE | nacos.core.auth.admin.enable | default : `true` |
| NACOS_AUTH_CONSOLE_ENABLE | nacos.core.auth.console.enable | default : `true` | |
| NACOS_CONSOLE_PORT | nacos.console.port | default : `8080` |
| NACOS_CONSOLE_CONTEXTPATH | nacos.console.contextPath | default : `` |
## 高级配置

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.0
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.0
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

@ -92,14 +92,6 @@ if [[ ! -z "${NACOS_AUTH_ENABLE}" ]]; then
JAVA_OPT="${JAVA_OPT} -Dnacos.core.auth.enabled=${NACOS_AUTH_ENABLE}"
fi
if [[ ! -z "${NACOS_AUTH_ADMIN_ENABLE}" ]]; then
JAVA_OPT="${JAVA_OPT} -Dnacos.core.auth.admin.enabled=${NACOS_AUTH_ADMIN_ENABLE}"
fi
if [[ ! -z "${NACOS_AUTH_CONSOLE_ENABLE}" ]]; then
JAVA_OPT="${JAVA_OPT} -Dnacos.core.auth.console.enabled=${NACOS_AUTH_CONSOLE_ENABLE}"
fi
if [[ -z "${NACOS_AUTH_TOKEN}" ]]; then
echo "env NACOS_AUTH_TOKEN must be set with Base64 String."
exit 255

View File

@ -194,7 +194,7 @@ server.error.include-message=ALWAYS
### Nacos Console Main port
nacos.console.port=${NACOS_CONSOLE_PORT:8080}
### Nacos Server Web context path:
nacos.console.contextPath=${NACOS_CONSOLE_CONTEXTPATH:}
nacos.console.contextPath=
### Nacos Server context path, which link to nacos server `nacos.server.contextPath`, works when deployment type is `console`
nacos.console.remote.server.context-path=${SERVER_SERVLET_CONTEXTPATH:/nacos}

View File

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

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: