Compare commits
10 Commits
Author | SHA1 | Date |
---|---|---|
|
26cc6b6056 | |
|
a3795ac461 | |
|
9c93392805 | |
|
bcc778c832 | |
|
baffa99131 | |
|
9e80494a69 | |
|
74df95080f | |
|
e76c828582 | |
|
c82efd39fd | |
|
a24b728c75 |
23
README.md
23
README.md
|
@ -40,13 +40,16 @@ 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
|
||||
```
|
||||
|
@ -69,11 +72,8 @@ Run the following command:
|
|||
* Standalone Mysql
|
||||
|
||||
```powershell
|
||||
# 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
|
||||
cd example
|
||||
./mysql-init.sh && docker-compose -f standalone-mysql.yaml up
|
||||
```
|
||||
|
||||
* Standalone Nacos Cluster
|
||||
|
@ -151,8 +151,13 @@ 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** |
|
||||
|
||||
| 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 : `` |
|
||||
|
||||
## Advanced configuration
|
||||
|
||||
|
|
13
README_ZH.md
13
README_ZH.md
|
@ -50,11 +50,8 @@
|
|||
* Standalone Mysql
|
||||
|
||||
```powershell
|
||||
# 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
|
||||
cd example
|
||||
./mysql-init.sh && docker-compose -f standalone-mysql.yaml up
|
||||
```
|
||||
|
||||
* docker单节点部署集群模式
|
||||
|
@ -171,10 +168,12 @@
|
|||
| 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 : `` |
|
||||
|
||||
## 高级配置
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ ENV MODE="cluster" \
|
|||
TOMCAT_ACCESSLOG_ENABLED="false" \
|
||||
TIME_ZONE="Asia/Shanghai"
|
||||
|
||||
ARG NACOS_VERSION=3.0.0
|
||||
ARG NACOS_VERSION=3.0.2
|
||||
ARG HOT_FIX_FLAG=""
|
||||
|
||||
WORKDIR $BASE_DIR
|
||||
|
@ -46,4 +46,5 @@ RUN mkdir -p logs \
|
|||
&& chmod +x bin/docker-startup.sh
|
||||
|
||||
EXPOSE 8848
|
||||
EXPOSE 9848 8080
|
||||
ENTRYPOINT ["sh","bin/docker-startup.sh"]
|
|
@ -1,6 +1,6 @@
|
|||
FROM amd64/buildpack-deps:buster-curl as installer
|
||||
|
||||
ARG NACOS_VERSION=3.0.0
|
||||
ARG NACOS_VERSION=3.0.2
|
||||
ARG HOT_FIX_FLAG=""
|
||||
|
||||
RUN set -x \
|
||||
|
@ -45,4 +45,5 @@ RUN mkdir -p logs \
|
|||
RUN chmod +x bin/docker-startup.sh
|
||||
|
||||
EXPOSE 8848
|
||||
EXPOSE 9848 8080
|
||||
ENTRYPOINT ["bin/docker-startup.sh"]
|
||||
|
|
|
@ -92,6 +92,14 @@ 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
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -1 +1 @@
|
|||
NACOS_VERSION=v3.0.0
|
||||
NACOS_VERSION=v3.0.2
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
#!/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}"
|
|
@ -17,14 +17,15 @@ services:
|
|||
restart: always
|
||||
mysql:
|
||||
container_name: mysql
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./image/mysql/8/Dockerfile
|
||||
image: example/mysql:8.0.30
|
||||
image: 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:
|
||||
|
|
Loading…
Reference in New Issue