create-aomex 0.0.33 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/Dockerfile.integration +4 -1
- package/templates/Dockerfile.production +4 -1
- package/templates/docker-compose.yml +12 -3
- package/templates/package.json +2 -0
- package/templates/scripts/build-in-docker.sh +2 -1
- package/templates/scripts/commit-develop-to-main.sh +10 -0
- package/templates/scripts/docker-cron-stats.sh +4 -0
- package/templates/scripts/start.mjs +3 -3
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
FROM node:{{nodeVersion}}
|
|
2
2
|
COPY . /codes
|
|
3
3
|
WORKDIR /codes
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
RUN mv .env.integration .env
|
|
6
6
|
|
|
7
7
|
ENV TZ=Asia/Shanghai
|
|
8
8
|
ENV PORT=3000
|
|
9
9
|
ENV NODE_ENV=integration
|
|
10
|
+
|
|
11
|
+
RUN sh scripts/build-in-docker.sh
|
|
12
|
+
|
|
10
13
|
CMD ["node", "--enable-source-maps", "src/web.js"]
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
FROM node:{{nodeVersion}}
|
|
2
2
|
COPY . /codes
|
|
3
3
|
WORKDIR /codes
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
RUN mv .env.production .env
|
|
6
6
|
|
|
7
7
|
ENV TZ=Asia/Shanghai
|
|
8
8
|
ENV PORT=3000
|
|
9
9
|
ENV NODE_ENV=production
|
|
10
|
+
|
|
11
|
+
RUN sh scripts/build-in-docker.sh
|
|
12
|
+
|
|
10
13
|
CMD ["node", "--enable-source-maps", "src/web.js"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
services:
|
|
2
|
-
|
|
3
|
-
image: mysql:8
|
|
2
|
+
mysql:
|
|
3
|
+
image: mysql:8
|
|
4
4
|
environment:
|
|
5
5
|
# 修改后需要同步修改.env里的参数
|
|
6
6
|
MYSQL_DATABASE: '{{projectName}}'
|
|
@@ -10,8 +10,17 @@ services:
|
|
|
10
10
|
ports:
|
|
11
11
|
- 3306:3306
|
|
12
12
|
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
|
13
|
+
mongo:
|
|
14
|
+
image: mongo:7
|
|
15
|
+
environment:
|
|
16
|
+
MONGO_INITDB_ROOT_USERNAME: root
|
|
17
|
+
MONGO_INITDB_ROOT_PASSWORD: abcde
|
|
18
|
+
volumes:
|
|
19
|
+
- ./volumes/mongo:/data/db
|
|
20
|
+
ports:
|
|
21
|
+
- 27017:27017
|
|
13
22
|
redis:
|
|
14
|
-
image: redis:7
|
|
23
|
+
image: redis:7
|
|
15
24
|
volumes:
|
|
16
25
|
- ./volumes/redis:/data
|
|
17
26
|
ports:
|
package/templates/package.json
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"start": "node scripts/start.mjs",
|
|
11
|
+
"cron:stats": "sh scripts/docker-cron-stats.sh",
|
|
12
|
+
"commit:main": "sh scripts/commit-develop-to-main.sh",
|
|
11
13
|
"deploy:production": "sh scripts/deploy.sh production",
|
|
12
14
|
"deploy:integration": "sh scripts/deploy.sh integration",
|
|
13
15
|
"prepare": "npx husky",
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
set -ex
|
|
4
4
|
|
|
5
5
|
corepack enable # package.json => packageManager
|
|
6
|
-
pnpm install
|
|
6
|
+
pnpm install --no-prod
|
|
7
7
|
pnpm exec prisma generate
|
|
8
8
|
pnpm exec tsc
|
|
9
9
|
pnpm exec tsc-alias --resolve-full-paths
|
|
10
10
|
rm -rf src
|
|
11
11
|
mv build/src .
|
|
12
12
|
pnpm install --prod
|
|
13
|
+
pnpm store prune
|
|
13
14
|
rm -rf node_modules/@types node_modules/*/*.d.ts
|
|
@@ -5,7 +5,7 @@ execSync('docker compose -f docker-compose.yml down', { stdio: 'inherit' });
|
|
|
5
5
|
|
|
6
6
|
const docker = spawn('docker compose -f docker-compose.yml up', {
|
|
7
7
|
stdio: ['inherit', 'inherit', 'pipe'],
|
|
8
|
-
shell:
|
|
8
|
+
shell: true,
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
await new Promise((resolve) => {
|
|
@@ -19,10 +19,10 @@ await new Promise((resolve) => {
|
|
|
19
19
|
|
|
20
20
|
const server = spawn(
|
|
21
21
|
'npx prisma migrate deploy && npx prisma generate && node --import tsx/esm --watch src/web.ts',
|
|
22
|
-
{ stdio: 'inherit', shell:
|
|
22
|
+
{ stdio: 'inherit', shell: true },
|
|
23
23
|
);
|
|
24
24
|
|
|
25
|
-
const cron = spawn('npx
|
|
25
|
+
const cron = spawn('npx aomex cron:start', { stdio: 'inherit', shell: true });
|
|
26
26
|
|
|
27
27
|
// 防止被其它逻辑清除监听
|
|
28
28
|
setTimeout(() => {
|