Spaces:
Running
Running
orztv
commited on
Commit
·
6a796f7
1
Parent(s):
e6f4cbc
update
Browse files- src/ecosystem.config.cjs +13 -0
- src/remix.sh +2 -0
- src/startup.sh +4 -2
src/ecosystem.config.cjs
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
module.exports = {
|
2 |
+
apps: [{
|
3 |
+
name: 'my-remix-app', // 应用名称
|
4 |
+
script: 'pnpm', // 要执行的命令
|
5 |
+
args: 'start', // 传递的参数
|
6 |
+
interpreter: 'none', // 不使用默认的 Node.js 解释器
|
7 |
+
watch: false, // 不监视文件变化
|
8 |
+
env: {
|
9 |
+
NODE_ENV: 'production',
|
10 |
+
PORT: 7860 // 环境变量
|
11 |
+
}
|
12 |
+
}]
|
13 |
+
};
|
src/remix.sh
CHANGED
@@ -6,6 +6,8 @@ echo "开始安装 Remix..."
|
|
6 |
# 使用 npx 来运行 create-remix
|
7 |
npx create-remix@latest ${REMIX_NAME} --yes --no-install --no-git-init
|
8 |
|
|
|
|
|
9 |
# 进入 Remix 项目目录
|
10 |
cd ${HOMEDIR}/${REMIX_NAME}
|
11 |
|
|
|
6 |
# 使用 npx 来运行 create-remix
|
7 |
npx create-remix@latest ${REMIX_NAME} --yes --no-install --no-git-init
|
8 |
|
9 |
+
cp ${HOMEDIR}/ecosystem.config.cjs ${HOMEDIR}/${REMIX_NAME}/ecosystem.config.cjs
|
10 |
+
|
11 |
# 进入 Remix 项目目录
|
12 |
cd ${HOMEDIR}/${REMIX_NAME}
|
13 |
|
src/startup.sh
CHANGED
@@ -2,5 +2,7 @@
|
|
2 |
|
3 |
# 使用 PM2 启动 Remix 应用,并传递 PORT 环境变量
|
4 |
cd ${HOMEDIR}/${REMIX_NAME}
|
5 |
-
|
6 |
-
|
|
|
|
|
|
2 |
|
3 |
# 使用 PM2 启动 Remix 应用,并传递 PORT 环境变量
|
4 |
cd ${HOMEDIR}/${REMIX_NAME}
|
5 |
+
pm2 start ecosystem.config.cjs
|
6 |
+
pm2 save
|
7 |
+
|
8 |
+
cd ${HOMEDIR}
|