Unverified Commit 8d57acc8 authored by 陈帅's avatar 陈帅 Committed by GitHub

add preview use docker (#2890)

parent 8058e4d8
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
/src/utils/request-temp.js /src/utils/request-temp.js
# production # production
/dist
/.vscode /.vscode
# misc # misc
......
FROM nginx
WORKDIR /usr/src/app/
COPY ./docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY ./dist /usr/share/nginx/html/
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file
...@@ -93,17 +93,22 @@ $ npm start # visit http://localhost:8000 ...@@ -93,17 +93,22 @@ $ npm start # visit http://localhost:8000
### Use by docker ### Use by docker
```bash ```bash
// dev # preview
$ docker pull chenshuai2144/ant-design-pro
$ docker run -p 80:80 chenshuai2144/ant-design-pro
# open http://localhost
# dev
$ npm run docker:dev $ npm run docker:dev
// build # build
$ npm run docker:build $ npm run docker:build
// production dev # production dev
$ npm run docker-prod:dev $ npm run docker-prod:dev
// production build # production build
$ npm run docker-prod:build $ npm run docker-prod:build
``` ```
......
...@@ -83,14 +83,19 @@ $ npm start # 访问 http://localhost:8000 ...@@ -83,14 +83,19 @@ $ npm start # 访问 http://localhost:8000
### 使用 docker ### 使用 docker
```bash ```bash
// dev # preview
$ docker pull chenshuai2144/ant-design-pro
$ docker run -p 80:80 chenshuai2144/ant-design-pro
# open http://localhost
# dev
$ npm run docker:dev $ npm run docker:dev
// build # build
$ npm run docker:build $ npm run docker:build
// production dev # production dev
$ npm run docker-prod:dev $ npm run docker-prod:dev
// production build // production build
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"start": "cross-env APP_TYPE=site umi dev", "start": "cross-env APP_TYPE=site umi dev",
"start:no-mock": "cross-env MOCK=none umi dev", "start:no-mock": "cross-env MOCK=none umi dev",
"build": "umi build", "build": "umi build",
"site": "npm run presite && cross-env APP_TYPE=site npm run build && firebase deploy", "site": "npm run presite && cross-env APP_TYPE=site npm run build && firebase deploy && npm run docker:push",
"analyze": "cross-env ANALYZE=1 umi build", "analyze": "cross-env ANALYZE=1 umi build",
"lint:style": "stylelint \"src/**/*.less\" --syntax less", "lint:style": "stylelint \"src/**/*.less\" --syntax less",
"lint": "eslint --ext .js src mock tests && npm run lint:style", "lint": "eslint --ext .js src mock tests && npm run lint:style",
...@@ -24,7 +24,10 @@ ...@@ -24,7 +24,10 @@
"docker:dev": "docker-compose -f ./docker/docker-compose.dev.yml up", "docker:dev": "docker-compose -f ./docker/docker-compose.dev.yml up",
"docker:build": "docker-compose -f ./docker/docker-compose.dev.yml build", "docker:build": "docker-compose -f ./docker/docker-compose.dev.yml build",
"docker-prod:dev": "docker-compose -f ./docker/docker-compose.yml up", "docker-prod:dev": "docker-compose -f ./docker/docker-compose.yml up",
"docker-prod:build": "docker-compose -f ./docker/docker-compose.yml build" "docker-prod:build": "docker-compose -f ./docker/docker-compose.yml build",
"docker-hub:build":"docker build -f Dockerfile.hub -t ant-design-pro ./",
"docker:tag":"docker tag ant-design-pro chenshuai2144/ant-design-pro",
"docker:push":"npm run docker-hub:build && npm run docker:tag && docker push chenshuai2144/ant-design-pro"
}, },
"dependencies": { "dependencies": {
"@babel/runtime": "^7.1.5", "@babel/runtime": "^7.1.5",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment