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
相关推荐
赵 XiaoQin14 分钟前
【无标题】
docker
小飞侠在吗2 小时前
vue computed 和 watch
前端·javascript·vue.js
may_一一3 小时前
docker安装的redis状态一直是restarting
java·redis·docker
cike_y3 小时前
浅谈用docker搭建一个ctf镜像
运维·安全·网络安全·docker·容器·ctf
毕设十刻3 小时前
基于Vue的考勤管理系统8n7j8(程序 + 源码 + 数据库 + 调试部署 + 开发环境配置),配套论文文档字数达万字以上,文末可获取,系统界面展示置于文末
前端·数据库·vue.js
自己的九又四分之三站台3 小时前
Docker容器启动中需要增加一个端口
docker·容器·eureka
cqsztech4 小时前
docker环境下 Oracle 19c 标准版如何转换为19c 企业版
docker·oracle·容器
❀͜͡傀儡师5 小时前
docker部署 paperless-ngx
运维·docker·容器
卌卄5 小时前
Linux下安装Docker
linux·运维·docker