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
相关推荐
Irene199112 分钟前
Vue3中 <slot >不支持 ref 属性的替代方案
vue.js·ref
多仔ヾ29 分钟前
Vue.js 前端开发实战之 10-网络请求和 UI 组件库
vue.js
optimistic_chen1 小时前
【Docker入门】Docker Image(Docker 镜像)
linux·运维·docker·容器·镜像
小林up1 小时前
Ubuntu使用阿里云安装docker
ubuntu·阿里云·docker
爱莉希雅&&&1 小时前
Docker 超详细全量笔记(含参数解释)
linux·运维·服务器·笔记·docker·容器
ヤ鬧鬧o.1 小时前
HTML多倒计时管理
前端·javascript·css·html5
橙露1 小时前
Docker 容器化运维:镜像优化、容器编排与持久化存储方案
java·运维·docker
你说爱像云 要自在漂浮才美丽1 小时前
【HTML5与CSS3】
前端·css3·html5
TDengine (老段)2 小时前
初学者使用 docker 快速体验 TDengine 功能
大数据·物联网·docker·容器·时序数据库·tdengine
多仔ヾ2 小时前
Vue.js 前端开发实战之 09-服务器端渲染
vue.js