Skip to content

Commit

Permalink
非必要不启动 unpkg 服务
Browse files Browse the repository at this point in the history
  • Loading branch information
hotlong committed Jan 6, 2025
1 parent 6428c1f commit 15a465c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 17 deletions.
12 changes: 11 additions & 1 deletion deploy/community/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@ RUN apt-get update || : && apt-get install -y \
curl \
build-essential

RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
# RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -

# 安装 nvm 并安装 Node.js
ENV NVM_DIR=/root/.nvm

RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash \
&& chmod +x "$NVM_DIR/nvm.sh" \
&& bash -c ". $NVM_DIR/nvm.sh && nvm install 14.21.3 && nvm alias default 14.21.3"

# 确保在构建过程中可用
ENV PATH=$NVM_DIR/versions/node/v14.21.3/bin:$PATH

RUN apt-get update \
&& apt-get install -y gnupg curl nodejs
Expand Down
3 changes: 0 additions & 3 deletions deploy/community/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ services:
- "9001:9001"
environment:
- ROOT_URL=http://127.0.0.1
- NPM_CACHE_ENABLED=true
- NPM_CACHE_PACKAGE_CONTENT=true
- NPM_REGISTRY_URL=https://registry.npmmirror.com
tty: true
volumes:
- "./steedos-storage:/steedos-storage"
Expand Down
6 changes: 6 additions & 0 deletions deploy/community/fs/opt/steedos/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ init_env_file() {
ENV_PATH="$CONF_PATH/docker.env"
TEMPLATES_PATH="/opt/steedos/templates"

if [[ "${STEEDOS_UNPKG_URL}" == /unpkg* ]]; then
export STEEDOS_UNPKG_ENABLED=true
else
export STEEDOS_UNPKG_ENABLED=false
fi

mkdir -p "$CONF_PATH"
# Build an env file with current env variables. We single-quote the values, as well as escaping any single-quote characters.
printenv | grep -E '^STEEDOS_|^B6_|^MONGO_|ROOT_URL|CACHER|TRANSPORTER|PORT|NODE_ENV' | sed "s/'/'\\\''/g; s/=/='/; s/$/'/" > "$CONF_PATH/pre-define.env"
Expand Down
20 changes: 11 additions & 9 deletions deploy/enterprise/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,27 @@ services:
- "traefik.enable=true"
- "traefik.http.routers.all.rule=PathPrefix(`/`)"
- "traefik.http.services.app1.loadbalancer.server.port=80"
env_file:
- .env
environment:
- STEEDOS_LICENSE=6e890bc491b8c1d0edfcaa717d301478e12aa60015922ff31c55db96f74947d941a7201460baba3d9c53ffefc961a2e8e91f98db286a83f47874a004a786a40ddb52c76e6a94d328ac43fd9d338806cd5bc71ed342a90cfe42e81f557690ca653ec1d8dcb906c7e0fd344feafdf5def156242caa4f52a738d37fa52f45edfd390d3e85fb7a35d25755d980eee6164f5208a1019d616e805fad737ee9a549becd710c2e642129efd58439c90c3aa5ce3665a6503590d66505ed64b909fd95a76de9e36bf46b4ad656a896e486a773c1ea1b43108ecb5e9db77ef3a311f28753f10225cb538ba04198cbbdc74b0e5dd13ba2fe024f202d8b7d00c13d6a8363d8cc8a2bf4a79c9f8387c0ae815aa57d4df63e3194c1606df34f60abf2bdf8697da93fa27e29f1f4c193960febcf46a804ee3bbf92d98effa2e6f219e2ee503afa9dfb894aa5396a0351496a0526ec710b03bb70262123c16b23d6fa67639cd80567d1f50db0df441fa707272e6d5e4f3702b7485173702cafc81a0e2bd8aa2c9cf37ff1c3dff6738b6ed4d52b3bd24d35a9fdef2ce6109e58891e222ed712fce8b10af8883256facc8e907ba5e493b6fa47f5b00956abc53e4a63448d752bb65da619d8972a639a517b22946cf43322f3fd375d6deee8519d35265f3d9960a2668c06b5737bcc6b7b2f5a7e598ed6175a4f194637dd0c43c94a71bbe5015c8cf36c,2022-0001
- ROOT_URL=http://127.0.0.1
# - STEEDOS_UNPKG_URL=/unpkg
- NPM_CACHE_ENABLED=true
- NPM_CACHE_PACKAGE_CONTENT=true
- NPM_REGISTRY_URL=https://registry.npmmirror.com
- NPM_CONFIG_REGISTRY=https://registry.npmmirror.com
- STEEDOS_WIDGETS_ADDITIONAL=@steedos-widgets/[email protected]
# - B6_SERVER_VERSION=0.11.5
- B6_PLUGIN_PACKAGES=@builder6/node-red@,lodash
- B6_PLUGIN_PACKAGES=@builder6/node-red,lodash
- B6_PLUGIN_SERVICES=@builder6/node-red
- B6_PLUGIN_MODULES=@builder6/node-red
- B6_OIDC_ENABLED=true
- B6_OIDC_ISSUER=https://id.steedos.cn/realms/master
- B6_OIDC_CLIENT_ID=steedos-oidc-public
- B6_OIDC_CLIENT_SECRET=none
- B6_OIDC_NAME=Steedos ID
- B6_OIDC_LABEL=Steedos ID
- B6_OIDC_ICON=https://www.steedos.com/favicon.png
# - B6_OIDC_ENABLED=false
# - B6_OIDC_ISSUER=https://id.steedos.cn/realms/master
# - B6_OIDC_CLIENT_ID=steedos-oidc-public
# - B6_OIDC_CLIENT_SECRET=none
# - B6_OIDC_NAME=Steedos ID
# - B6_OIDC_LABEL=Steedos ID
# - B6_OIDC_LOGO=https://www.steedos.com/favicon.png

tty: true
volumes:
Expand Down
8 changes: 8 additions & 0 deletions deploy/enterprise/fs/opt/steedos/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ init_env_file() {
TEMPLATES_PATH="/opt/steedos/templates"

mkdir -p "$CONF_PATH"

if [[ "${STEEDOS_UNPKG_URL}" == /unpkg* ]]; then
export STEEDOS_UNPKG_ENABLED=true
else
export STEEDOS_UNPKG_ENABLED=false
fi


# Build an env file with current env variables. We single-quote the values, as well as escaping any single-quote characters.
printenv | grep -E '^STEEDOS_|^B6_|^MONGO_|ROOT_URL|CACHER|TRANSPORTER|PORT|NODE_ENV' | sed "s/'/'\\\''/g; s/=/='/; s/$/'/" > "$CONF_PATH/pre-define.env"

Expand Down
4 changes: 0 additions & 4 deletions deploy/enterprise/fs/opt/steedos/run-with-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ set +o allexport
# export STEEDOS_UNPKG_URL=/unpkg
# fi

if [[ "${STEEDOS_UNPKG_URL}" == /unpkg* ]] && [[ ! -z "${STEEDOS_LICENSE}" ]]; then
export STEEDOS_UNPKG_ENABLED=true
fi

if [[ -z "${STEEDOS_STORAGE_DIR}" ]]; then
export STEEDOS_STORAGE_DIR=/steedos-storage/
fi
Expand Down

0 comments on commit 15a465c

Please sign in to comment.