22

武汉肺炎疫情地图(React版)

 4 years ago
source link: https://juejin.im/post/5e3a4f7ae51d4527066e811b
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

ncov肺炎疫情地图(React版)

2020年02月05日 阅读 6092

ncov肺炎疫情地图(React版)

武汉加油🍻

线上地址:疫情实时预览

git地址:2019-nCoV-Virus

看见了许多大佬都在写疫情可视化工具,所以我也按耐不住了。希望能为疫情的防控做出一点点微薄的贡献。

  • 人数情况查看
  • 全国和各省市疫情地图及其详细信息查看
  • 死亡率和治愈率
1
1
1
1
1
1
  • clone项目: git clone github.com/xieyezi/201…
  • 安装依赖: cd 2019-nCoV-Virus && yarn install
  • 运行: yarn start
  • 打包: yarn build
  • 运行打包文件: yarn global add serve && serve build

通过docker的Dockerfile文件制作为镜像,然后通过nginx来进行部署。 Dockerfile:

# ncov Dockerfile

#指定node镜像对项目进行依赖安装和打包
FROM node:10.16.0 AS builder
# 将容器的工作目录设置为/app(当前目录,如果/app不存在,WORKDIR会创建/app文件夹)
WORKDIR /app 
COPY package.json /app/ 
RUN npm config set registry "https://registry.npm.taobao.org/" \
    && npm install
 
COPY . /app   
RUN npm run build 

#指定nginx配置项目,--from=builder 指的是从上一次 build 的结果中提取了编译结果(FROM node:alpine as builder),即是把刚刚打包生成的dist放进nginx中
FROM nginx
COPY --from=builder app/build /usr/share/nginx/html/
COPY --from=builder app/nginx.conf /etc/nginx/nginx.conf


#暴露容器80端口
EXPOSE 80
复制代码

在此特地鸣谢!
希望武汉疫情能够早日过去!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK