docker部署vue router history HTML5 模式

构建容器

nginx 配置 default.conf

powershell 复制代码
server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;
    access_log  /var/log/nginx/host.access.log  main;
    error_log  /var/log/nginx/error.log  error;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
        try_files $uri $uri/ /index.html;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}

Dockerfile

powershell 复制代码
FROM nginx:latest
COPY default.conf /etc/nginx/conf.d/default.conf
powershell 复制代码
docker build -t oavue:1.0 .

docker compose

powershellversion: 复制代码
services:
  oa-history-web:
      image: oavue:1.0
      container_name: oa-history-web
      ports:
        - 1180:80
      volumes:
        - /home/iiip603/docker/oa/html/dist:/usr/share/nginx/html
相关推荐
WeiXin_DZbishe1 小时前
基于springboot城市公交实时运营与调度系统-计算机毕设 附源码【课程设计】66173
java·vue.js·spring boot·后端·python·php·课程设计
WeiXin_DZbishe2 小时前
基于Springboot+AI的kuall音乐广场的设计与实现-计算机毕设 附源码【课程设计】12715
vue.js·人工智能·spring boot·后端·python·php·课程设计
_馒头2 小时前
pixiJs游戏开发实践 - 跳棋小游戏
javascript·vue.js
VIP_CQCRE3 小时前
给团队搭一个 AI 工作台:Open WebUI 接入 Ace Data Cloud 实战
docker·ai·rag·open webui·ace data cloud
AIGC小尼3 小时前
毕设实战|SpringBoot+Vue 实现多个系统项目
vue.js·spring boot·课程设计
米柆4 小时前
HTML5 audio /video 完整事件监听模板
前端·html·html5
踩着两条虫6 小时前
我在浏览器里“盖”了一个村:Vue + Three.js 大屏开发踩坑记
前端·vue.js·three.js
程序员老赵7 小时前
Docker 部署 Portainer CE:轻松搭建容器管理平台
docker·容器·开源
TTATTC7 小时前
Gmail、Drive、日历共用一套命令:gws 如何在运行时把 Discovery 文档编译成 CLI
docker·开源
高级程序源8 小时前
SSM仓储管理系统31582-计算机课程设计、毕业设计
vue.js·python·mysql·小程序·flask·课程设计