Update docker command

This commit is contained in:
medcl 2020-03-27 11:38:30 +08:00
parent 83d4113193
commit cdec440220
3 changed files with 13 additions and 7 deletions

View File

@ -38,7 +38,7 @@ npm run docker:build
cnpm run docker:dev cnpm run docker:dev
``` ```
启动完成,稍等片刻,打开 http://localhost:10000/,手动刷新即可看到最新的更改。 启动完成,稍等片刻,打开 http://localhost:7001/,手动刷新即可看到最新的更改。
#### 手动更新开发镜像 #### 手动更新开发镜像
@ -70,7 +70,7 @@ cnpm install
cnpm run dev cnpm run dev
``` ```
在浏览器中访问:[http://localhost:8000](http://localhost:8000) 在浏览器中访问:[http://localhost:8000](http://localhost:7001)
### 构建和部署 ### 构建和部署
@ -79,7 +79,13 @@ cnpm run dev
cnpm run build cnpm run build
``` ```
执行该命令后会生成最终的 HTML、CSS 和 JS 到 `dist` 目录下。它们是浏览器可以直接识别并运行的代码,这样你就可以将它们部署到你想要的服务器上了。 执行该命令后会生成最终的 HTML、CSS 和 JS 到 `app/public` 目录下。它们是浏览器可以直接识别并运行的代码,这样你就可以将它们部署到你想要的服务器上了。
或者使用 Docker 来运行最终的程序。
```
cnpm run docker:prod
```
启动完成,稍等片刻,打开 http://localhost:8001/,即可看到最终的程序界面。
### 新增项目依赖包 ### 新增项目依赖包
``` ```

View File

@ -11,9 +11,9 @@ services:
# dockerfile: docker/Dockerfile # dockerfile: docker/Dockerfile
ports: ports:
- 3000:3000 # - 3000:3000
- 7001:7001 - 8001:7001
- 10000:10000 # - 10000:10000
container_name: "infini-nodejs-release" container_name: "infini-nodejs-release"
volumes: volumes:
- ../app:/usr/src/app/app - ../app:/usr/src/app/app

View File

@ -90,7 +90,7 @@
"docker:stop-dev": "docker-compose -f ./docker/docker-compose.dev.yml down", "docker:stop-dev": "docker-compose -f ./docker/docker-compose.dev.yml down",
"docker:build-release-images": "docker-compose -f ./docker/docker-compose.release.yml build", "docker:build-release-images": "docker-compose -f ./docker/docker-compose.release.yml build",
"docker:prod": "docker-compose -f ./docker/docker-compose.release.yml up -d", "docker:prod": "docker-compose -f ./docker/docker-compose.release.yml up -d",
"docker:stop-prod": "docker-compose -f ./docker/docker-compose.release.yml up down" "docker:stop-prod": "docker-compose -f ./docker/docker-compose.release.yml down"
}, },
"ci": { "ci": {