Skip to content

Commit 85fb6c6

Browse files
committed
docker容器内执行指令不需要npx
1 parent 99ce778 commit 85fb6c6

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

templates/Dockerfile.integration

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ENV TZ=Asia/Shanghai
88
ENV PORT=3000
99
ENV NODE_ENV=integration
1010
ENV NODE_OPTIONS='--enable-source-maps --stack-trace-limit=50'
11+
ENV PATH="$PATH:/codes/node_modules/.bin"
1112

1213
RUN sh scripts/build-in-docker.sh
1314

templates/Dockerfile.production

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ENV TZ=Asia/Shanghai
88
ENV PORT=3000
99
ENV NODE_ENV=production
1010
ENV NODE_OPTIONS='--enable-source-maps --stack-trace-limit=50'
11+
ENV PATH="$PATH:/codes/node_modules/.bin"
1112

1213
RUN sh scripts/build-in-docker.sh
1314

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
services:
22
migration:
33
image: {{projectName}}:integration
4-
command: npx prisma migrate deploy
4+
command: prisma migrate deploy
55
api:
66
image: {{projectName}}:integration
77
ports:
88
- 3000:3000
99
cron:
1010
image: {{projectName}}:integration
11-
command: npx aomex cron:start
11+
command: aomex cron:start
1212
restart: always
1313
environment:
1414
- NODE_COMPILE_CACHE=/tmp

templates/docker-compose-production.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
migration:
33
image: {{projectName}}:production
4-
command: npx prisma migrate deploy
4+
command: prisma migrate deploy
55
api:
66
image: {{projectName}}:production
77
ulimits:
@@ -12,7 +12,7 @@ services:
1212
- 3000:3000
1313
cron:
1414
image: {{projectName}}:production
15-
command: npx aomex cron:start
15+
command: aomex cron:start
1616
restart: always
1717
environment:
1818
- NODE_COMPILE_CACHE=/tmp

0 commit comments

Comments
 (0)