diff --git a/apps/node/18.18.0/data.yml b/apps/node/18.20.3/data.yml similarity index 100% rename from apps/node/18.18.0/data.yml rename to apps/node/18.20.3/data.yml diff --git a/apps/node/18.18.0/docker-compose.yml b/apps/node/18.20.3/docker-compose.yml similarity index 90% rename from apps/node/18.18.0/docker-compose.yml rename to apps/node/18.20.3/docker-compose.yml index 87b874e3..6778d948 100644 --- a/apps/node/18.18.0/docker-compose.yml +++ b/apps/node/18.20.3/docker-compose.yml @@ -1,6 +1,6 @@ services: node: - image: node:${NODE_VERSION} + image: 1panel/node:${NODE_VERSION} container_name: ${CONTAINER_NAME} working_dir: /app volumes: diff --git a/apps/node/21.6.2/run.sh b/apps/node/18.20.3/run.sh similarity index 73% rename from apps/node/21.6.2/run.sh rename to apps/node/18.20.3/run.sh index e7228d42..7c1a28c1 100644 --- a/apps/node/21.6.2/run.sh +++ b/apps/node/18.20.3/run.sh @@ -6,6 +6,8 @@ if [[ "$PACKAGE_MANAGER" == "npm" ]]; then npm config set registry $CONTAINER_PACKAGE_URL elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then yarn config set registry $CONTAINER_PACKAGE_URL +elif [[ "$PACKAGE_MANAGER" == "pnpm" ]]; then + pnpm config set registry $CONTAINER_PACKAGE_URL fi if [[ "$RUN_INSTALL" -eq "1" ]]; then @@ -13,6 +15,8 @@ if [[ "$RUN_INSTALL" -eq "1" ]]; then npm install elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then yarn install + elif [[ "$PACKAGE_MANAGER" == "pnpm" ]]; then + pnpm install else echo "未知的 PACKAGE_MANAGER: $PACKAGE_MANAGER" exit 1 @@ -27,9 +31,8 @@ else npm run $EXEC_SCRIPT elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then yarn run $EXEC_SCRIPT + elif [[ "$PACKAGE_MANAGER" == "pnpm" ]]; then + pnpm run $EXEC_SCRIPT fi fi - - - diff --git a/apps/node/20.11.1/data.yml b/apps/node/20.14.0/data.yml similarity index 100% rename from apps/node/20.11.1/data.yml rename to apps/node/20.14.0/data.yml diff --git a/apps/node/21.6.2/docker-compose.yml b/apps/node/20.14.0/docker-compose.yml similarity index 90% rename from apps/node/21.6.2/docker-compose.yml rename to apps/node/20.14.0/docker-compose.yml index 87b874e3..6778d948 100644 --- a/apps/node/21.6.2/docker-compose.yml +++ b/apps/node/20.14.0/docker-compose.yml @@ -1,6 +1,6 @@ services: node: - image: node:${NODE_VERSION} + image: 1panel/node:${NODE_VERSION} container_name: ${CONTAINER_NAME} working_dir: /app volumes: diff --git a/apps/node/20.11.1/run.sh b/apps/node/20.14.0/run.sh similarity index 73% rename from apps/node/20.11.1/run.sh rename to apps/node/20.14.0/run.sh index e7228d42..7c1a28c1 100644 --- a/apps/node/20.11.1/run.sh +++ b/apps/node/20.14.0/run.sh @@ -6,6 +6,8 @@ if [[ "$PACKAGE_MANAGER" == "npm" ]]; then npm config set registry $CONTAINER_PACKAGE_URL elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then yarn config set registry $CONTAINER_PACKAGE_URL +elif [[ "$PACKAGE_MANAGER" == "pnpm" ]]; then + pnpm config set registry $CONTAINER_PACKAGE_URL fi if [[ "$RUN_INSTALL" -eq "1" ]]; then @@ -13,6 +15,8 @@ if [[ "$RUN_INSTALL" -eq "1" ]]; then npm install elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then yarn install + elif [[ "$PACKAGE_MANAGER" == "pnpm" ]]; then + pnpm install else echo "未知的 PACKAGE_MANAGER: $PACKAGE_MANAGER" exit 1 @@ -27,9 +31,8 @@ else npm run $EXEC_SCRIPT elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then yarn run $EXEC_SCRIPT + elif [[ "$PACKAGE_MANAGER" == "pnpm" ]]; then + pnpm run $EXEC_SCRIPT fi fi - - - diff --git a/apps/node/21.6.2/data.yml b/apps/node/21.7.3/data.yml similarity index 100% rename from apps/node/21.6.2/data.yml rename to apps/node/21.7.3/data.yml diff --git a/apps/node/20.11.1/docker-compose.yml b/apps/node/21.7.3/docker-compose.yml similarity index 90% rename from apps/node/20.11.1/docker-compose.yml rename to apps/node/21.7.3/docker-compose.yml index 87b874e3..6778d948 100644 --- a/apps/node/20.11.1/docker-compose.yml +++ b/apps/node/21.7.3/docker-compose.yml @@ -1,6 +1,6 @@ services: node: - image: node:${NODE_VERSION} + image: 1panel/node:${NODE_VERSION} container_name: ${CONTAINER_NAME} working_dir: /app volumes: diff --git a/apps/node/18.18.0/run.sh b/apps/node/21.7.3/run.sh similarity index 51% rename from apps/node/18.18.0/run.sh rename to apps/node/21.7.3/run.sh index 3187406d..7c1a28c1 100644 --- a/apps/node/18.18.0/run.sh +++ b/apps/node/21.7.3/run.sh @@ -6,6 +6,8 @@ if [[ "$PACKAGE_MANAGER" == "npm" ]]; then npm config set registry $CONTAINER_PACKAGE_URL elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then yarn config set registry $CONTAINER_PACKAGE_URL +elif [[ "$PACKAGE_MANAGER" == "pnpm" ]]; then + pnpm config set registry $CONTAINER_PACKAGE_URL fi if [[ "$RUN_INSTALL" -eq "1" ]]; then @@ -13,6 +15,8 @@ if [[ "$RUN_INSTALL" -eq "1" ]]; then npm install elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then yarn install + elif [[ "$PACKAGE_MANAGER" == "pnpm" ]]; then + pnpm install else echo "未知的 PACKAGE_MANAGER: $PACKAGE_MANAGER" exit 1 @@ -20,8 +24,15 @@ if [[ "$RUN_INSTALL" -eq "1" ]]; then fi -if [[ "$PACKAGE_MANAGER" == "npm" ]]; then - npm run $EXEC_SCRIPT -elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then - yarn run $EXEC_SCRIPT +if [[ "$CUSTOM_SCRIPT" -eq "1" ]]; then + $EXEC_SCRIPT +else + if [[ "$PACKAGE_MANAGER" == "npm" ]]; then + npm run $EXEC_SCRIPT + elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then + yarn run $EXEC_SCRIPT + elif [[ "$PACKAGE_MANAGER" == "pnpm" ]]; then + pnpm run $EXEC_SCRIPT + fi fi + diff --git a/apps/node/22.2.0/data.yml b/apps/node/22.2.0/data.yml new file mode 100644 index 00000000..fcc6ed69 --- /dev/null +++ b/apps/node/22.2.0/data.yml @@ -0,0 +1 @@ +additionalProperties: \ No newline at end of file diff --git a/apps/node/22.2.0/docker-compose.yml b/apps/node/22.2.0/docker-compose.yml new file mode 100644 index 00000000..6778d948 --- /dev/null +++ b/apps/node/22.2.0/docker-compose.yml @@ -0,0 +1,18 @@ +services: + node: + image: 1panel/node:${NODE_VERSION} + container_name: ${CONTAINER_NAME} + working_dir: /app + volumes: + - ${CODE_DIR}:/app + - ./run.sh:/run.sh + - ./.env:/.env + command: bash /run.sh + networks: + - 1panel-network + ports: + - ${HOST_IP}:${PANEL_APP_PORT_HTTP}:${NODE_APP_PORT} + restart: always +networks: + 1panel-network: + external: true diff --git a/apps/node/22.2.0/run.sh b/apps/node/22.2.0/run.sh new file mode 100644 index 00000000..7c1a28c1 --- /dev/null +++ b/apps/node/22.2.0/run.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +source /.env + +if [[ "$PACKAGE_MANAGER" == "npm" ]]; then + npm config set registry $CONTAINER_PACKAGE_URL +elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then + yarn config set registry $CONTAINER_PACKAGE_URL +elif [[ "$PACKAGE_MANAGER" == "pnpm" ]]; then + pnpm config set registry $CONTAINER_PACKAGE_URL +fi + +if [[ "$RUN_INSTALL" -eq "1" ]]; then + if [[ "$PACKAGE_MANAGER" == "npm" ]]; then + npm install + elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then + yarn install + elif [[ "$PACKAGE_MANAGER" == "pnpm" ]]; then + pnpm install + else + echo "未知的 PACKAGE_MANAGER: $PACKAGE_MANAGER" + exit 1 + fi +fi + + +if [[ "$CUSTOM_SCRIPT" -eq "1" ]]; then + $EXEC_SCRIPT +else + if [[ "$PACKAGE_MANAGER" == "npm" ]]; then + npm run $EXEC_SCRIPT + elif [[ "$PACKAGE_MANAGER" == "yarn" ]]; then + yarn run $EXEC_SCRIPT + elif [[ "$PACKAGE_MANAGER" == "pnpm" ]]; then + pnpm run $EXEC_SCRIPT + fi +fi +