create-aomex 0.0.11 → 0.0.12
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/docker-compose-integration.yml +4 -4
- package/templates/docker-compose-production.yml +13 -0
- package/templates/docker-compose.yml +16 -11
- package/templates/scripts/deploy-integration.sh +6 -5
- package/templates/scripts/deploy-production.sh +6 -5
- package/templates/scripts/start.mjs +2 -2
- package/templates/docker-compose-development.yml +0 -18
- /package/templates/{Dockerfile → Dockerfile.production} +0 -0
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
services:
|
|
2
2
|
migration:
|
|
3
|
-
image: {{projectName}}:
|
|
3
|
+
image: {{projectName}}:integration
|
|
4
4
|
command: npx prisma migrate deploy
|
|
5
5
|
api:
|
|
6
|
-
image: {{projectName}}:
|
|
6
|
+
image: {{projectName}}:integration
|
|
7
7
|
restart: always
|
|
8
8
|
ports:
|
|
9
9
|
- 3000:3000
|
|
10
10
|
cron:
|
|
11
|
-
image: {{projectName}}:
|
|
12
|
-
container_name: {{projectName}}-cron
|
|
11
|
+
image: {{projectName}}:integration
|
|
12
|
+
container_name: {{projectName}}-cron-integration
|
|
13
13
|
command: npx aomex cron:start
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
services:
|
|
2
|
+
migration:
|
|
3
|
+
image: {{projectName}}:production
|
|
4
|
+
command: npx prisma migrate deploy
|
|
5
|
+
api:
|
|
6
|
+
image: {{projectName}}:production
|
|
7
|
+
restart: always
|
|
8
|
+
ports:
|
|
9
|
+
- 3000:3000
|
|
10
|
+
cron:
|
|
11
|
+
image: {{projectName}}:production
|
|
12
|
+
container_name: {{projectName}}-cron-production
|
|
13
|
+
command: npx aomex cron:start
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
services:
|
|
2
|
-
|
|
3
|
-
image:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
db:
|
|
3
|
+
image: mysql:8.4
|
|
4
|
+
environment:
|
|
5
|
+
# 修改后需要同步修改.env里的参数
|
|
6
|
+
MYSQL_DATABASE: aomex_db
|
|
7
|
+
MYSQL_ROOT_PASSWORD: abcde
|
|
8
|
+
volumes:
|
|
9
|
+
- ./volumes/mysql:/var/lib/mysql
|
|
8
10
|
ports:
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
- 3306:3306
|
|
12
|
+
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
|
13
|
+
redis:
|
|
14
|
+
image: redis:7.4
|
|
15
|
+
volumes:
|
|
16
|
+
- ./volumes/redis:/data
|
|
17
|
+
ports:
|
|
18
|
+
- 6379:6379
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
set -ex
|
|
4
4
|
|
|
5
|
-
sudo docker build --tag {{projectName}}:
|
|
5
|
+
sudo docker build --tag {{projectName}}:integration --file Dockerfile.integration .
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
cron_container_name={{projectName}}-cron-integration
|
|
8
|
+
container_exist=$(sudo docker ps | { grep $cron_container_name || :; })
|
|
9
|
+
if [ -n "$container_exist" ];
|
|
9
10
|
then
|
|
10
|
-
sudo docker exec it
|
|
11
|
+
sudo docker exec it $cron_container_name /bin/sh -c "npx aomex cron:stop"
|
|
11
12
|
fi
|
|
12
13
|
|
|
13
|
-
sudo docker compose --file
|
|
14
|
+
sudo docker compose --file docker-compose-integration.yml up -d --timeout=1
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
set -ex
|
|
4
4
|
|
|
5
|
-
sudo docker build --tag {{projectName}}:
|
|
5
|
+
sudo docker build --tag {{projectName}}:production --file Dockerfile.production .
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
cron_container_name={{projectName}}-cron-production
|
|
8
|
+
container_exist=$(sudo docker ps | { grep $cron_container_name || :; })
|
|
9
|
+
if [ -n "$container_exist" ];
|
|
9
10
|
then
|
|
10
|
-
sudo docker exec it
|
|
11
|
+
sudo docker exec it $cron_container_name /bin/sh -c "npx aomex cron:stop"
|
|
11
12
|
fi
|
|
12
13
|
|
|
13
|
-
sudo docker compose --file
|
|
14
|
+
sudo docker compose --file docker-compose-production.yml up -d --timeout=1
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { execSync, spawn } from 'node:child_process';
|
|
2
2
|
import process from 'node:process';
|
|
3
3
|
|
|
4
|
-
execSync('docker compose -f docker-compose
|
|
4
|
+
execSync('docker compose -f docker-compose.yml down', { stdio: 'inherit' });
|
|
5
5
|
|
|
6
|
-
const docker = spawn('docker compose -f docker-compose
|
|
6
|
+
const docker = spawn('docker compose -f docker-compose.yml up', {
|
|
7
7
|
stdio: ['inherit', 'inherit', 'pipe'],
|
|
8
8
|
shell: 'zsh',
|
|
9
9
|
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
services:
|
|
2
|
-
db:
|
|
3
|
-
image: mysql:8.4
|
|
4
|
-
environment:
|
|
5
|
-
# 修改后需要同步修改.env里的参数
|
|
6
|
-
MYSQL_DATABASE: aomex_db
|
|
7
|
-
MYSQL_ROOT_PASSWORD: abcde
|
|
8
|
-
volumes:
|
|
9
|
-
- ./volumes/mysql:/var/lib/mysql
|
|
10
|
-
ports:
|
|
11
|
-
- 3306:3306
|
|
12
|
-
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
|
13
|
-
redis:
|
|
14
|
-
image: redis:7.4
|
|
15
|
-
volumes:
|
|
16
|
-
- ./volumes/redis:/data
|
|
17
|
-
ports:
|
|
18
|
-
- 6379:6379
|
|
File without changes
|