多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
基于ruoyi-vue项目的前端ui ### nginx.conf ``` worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name localhost; charset utf-8; location / { root /usr/share/nginx/html; try_files $uri $uri/ /index.html; index index.html index.htm; } location /prod-api/ { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header REMOTE-HOST $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://localhost:9185/; } location /webSocket/ { proxy_pass http://localhost:9185/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } } ``` ### Dockerfile 文件 ``` FROM nginx:latest EXPOSE 80 COPY ./dist /usr/share/nginx/html COPY ./nginx.conf /etc/nginx/nginx.conf ENTRYPOINT nginx -g "daemon off;" ``` ### 编译成镜像 ``` docker build -t ruoyi-ui:1.0.1 . ``` **注意**:最后一个` .` 不能少 ### 创建容器,运行镜像 ``` docker run -d -p 80:80 --net host --restart always --privileged=true -e TZ=Asia/Shanghai --name ruoyi-ui ruoyi-ui:1.0.1 ``` **注意**:`--net host` 不可少. `-e TZ=Asia/Shanghai`解决时区问题 ##### 2022-06-04编辑