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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-aomex",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "repository": "git@github.com:aomex/create-aomex.git",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,13 +1,13 @@
1
1
  services:
2
2
  migration:
3
- image: {{projectName}}:latest
3
+ image: {{projectName}}:integration
4
4
  command: npx prisma migrate deploy
5
5
  api:
6
- image: {{projectName}}:latest
6
+ image: {{projectName}}:integration
7
7
  restart: always
8
8
  ports:
9
9
  - 3000:3000
10
10
  cron:
11
- image: {{projectName}}:latest
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
- migration:
3
- image: {{projectName}}:latest
4
- command: npx prisma migrate deploy
5
- api:
6
- image: {{projectName}}:latest
7
- restart: always
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
- - 3000:3000
10
- cron:
11
- image: {{projectName}}:latest
12
- container_name: {{projectName}}-cron
13
- command: npx aomex cron:start
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}}:latest --file Dockerfile.integration .
5
+ sudo docker build --tag {{projectName}}:integration --file Dockerfile.integration .
6
6
 
7
- cron_container=$(sudo docker ps | { grep "{{projectName}}-cron" || :; })
8
- if [ -n "$cron_container" ];
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 {{projectName}}-cron /bin/sh -c "npx aomex cron:stop"
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 Dockerfile.integration up -d --timeout=1
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}}:latest --file Dockerfile .
5
+ sudo docker build --tag {{projectName}}:production --file Dockerfile.production .
6
6
 
7
- cron_container=$(sudo docker ps | { grep "{{projectName}}-cron" || :; })
8
- if [ -n "$cron_container" ];
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 {{projectName}}-cron /bin/sh -c "npx aomex cron:stop"
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 Dockerfile up -d --timeout=1
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-development.yml down', { stdio: 'inherit' });
4
+ execSync('docker compose -f docker-compose.yml down', { stdio: 'inherit' });
5
5
 
6
- const docker = spawn('docker compose -f docker-compose-development.yml up', {
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