惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
IT之家
IT之家
V
Visual Studio Blog
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 聂微东
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
大猫的无限游戏
大猫的无限游戏
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
D
Docker
MyScale Blog
MyScale Blog
小众软件
小众软件
云风的 BLOG
云风的 BLOG
美团技术团队
Microsoft Azure Blog
Microsoft Azure Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 【当耐特】

博客园 - 青玄鸟

.NET 中优雅处理 Server-Sent Events 请求取消 vue3.0 + ts 实现上传工厂(oss与cos) Dapr 订阅者参数无法正确反序列化问题 .NET 代码整洁手册 Moq mock 方法返回null空指针异常 基于接口隔离原则的依赖注入实现 HttpClient with Stream HttpClient partial update HttpClient 基本使用 值对象的封装 只读集合类型属性实现 适配器模式 模板模式 最少知识原则 单例模式 抽象工厂 简单工厂、工厂方法、抽象工厂 工厂方法模式 使用 Visual Studio Code创建和执行T-SQL
Blazor项目通过docker和nginx部署为静态站点的步骤
青玄鸟 · 2021-10-12 · via 博客园 - 青玄鸟
  1. 通过visual studio或者其他方式发布程序,以保证在输出中移除不必要的依赖项,减少程序集的尺寸。

  2. 创建dockerfile
    dockerfile是相当直截了当的,拉取nginx镜像然后从WWWRoot文件夹拷贝Blazor WebAssembly文件到nginx的html文件夹

    FROM nginx:alpine   
    EXPOSE 80   
    COPY bin/Release/netcoreapp3.1/publish/wwwroot /usr/share/nginx/html
    
  3. build docker 镜像
    docker build --tag blazorstatic .

  4. Run docker 容器
    docker run -p 8080:80 blazorstatic

  5. 使用浏览器访问blazor webapp
    http://localhost:8080

原文地址

posted @ 2021-10-12 23:44  青玄鸟  阅读(538)  评论(0)    收藏  举报