https://github.com/macrozheng/mall
http://localhost:8080
前台(Vue+Element)
https://github.com/macrozheng/mall-admin-web
前台佈署
http://www.macrozheng.com/#/deploy/mall_deploy_web
npm install node@8.9.4
修改\config\dev.env.js,把BASE_API改成自己開發環境網址(預設是8080)
npm run dev
登入頁面
http://localhost:8090
預設帳密:admin/macro123
微服務
https://github.com/macrozheng/mall-swarm
教學
https://github.com/macrozheng/
※Docker佈署
http://www.macrozheng.com/#/deploy/mall_deploy_docker
請先修改Docker組態檔開放TCP 2375 (有資安風險,請僅用於開發環境!)
vi /usr/lib/systemd/system/docker.service
加入以下組態
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
參考
https://www.cnblogs.com/hongdada/p/11512901.html
重啟Docker服務
systemctl daemon-reload
systemctl restart docker
\mall\pom.xml內的<docker.host>修改成自己的Docker主機IP位址
\mall\mall-admin\pom.xml內的<plugin>區塊請取消註解,並package推送images
\mall\mall-search\pom.xml內的<plugin>區塊請取消註解,並package推送images
\mall\mall-portal\pom.xml內的<plugin>區塊請取消註解,並package推送images
package推送images後使用docker images指令確認推送成功到伺服器:
# 啟動所有的 containers
因為啟動有順序性,第一次啟動失敗再執行一次指令
$ docker start $(docker ps -a -q)
參考
https://ithelp.ithome.com.tw/articles/10186431
※編譯問題
因為mall-admin專案相依於mall-mbg和mall-security,又間接相依於mall-common,請依下圖方式先mvn install把相依專案編譯成jar安裝到local repository
編譯錯誤訊息
[ERROR] Failed to execute goal on project mall-mbg: Could not resolve dependencies for project com.macro.mall:mall-mbg:jar:1.0-SNAPSHOT: Could not find artifact com.macro.mall:mall-common:jar:1.0-SNAPSHOT -> [Help 1]
※Lombok
以下package的程式有使用到Lombok
package com.macro.mall.dto;
package com.macro.mall.portal.domain;
package com.macro.mall.security.config;