华为云 Flexus X 实例 docker 部署 ERPnext 构建属于自己的企业资源规划系统

宙斯科技 后端 最近


· 华为云最近正在举办 828 B2B 企业节,Flexus X 实例的促销力度非常大,特别适合那些对算力性能有高要求的小伙伴。如果你有自建 MySQL、Redis、Nginx 等服务的需求,一定不要错过这个机会。赶紧去看看吧!

什么是华为云 Flexus X 实例

· 华为云 Flexus X 实例云服务是新一代开箱即用、体验跃级、面向中小企业和开发者打造的高品价比云服务产品。

· Flexus 云服务器 X 实例是新一代面向中小企业和开发者打造的柔性算力云服务器,可智能感知业务负载,适用于电商直播、企业建站、开发测试环境、游戏服务器、音视频服务等中低负载场景。

开始接触华为云 Flexus 云服务器 X 实例

· 获取华为云 Flexus 云服务器 X 实例后第一步就是先去华为云上重置服务器密码 

 

· 重置完毕后用 ssh 工具登录华为云服务器,这里我用的是 finalshell,也可以用其他工具登陆比如 xshell 或者 Putty 都可以 

· 登录上去查看硬盘大小,可以看到是 100g 硬盘,硬盘总大小是正常的

root@flexusx-ebe8:~# df -hFilesystem      Size  Used Avail Use% Mounted ontmpfs           1.2G  1.1M  1.2G   1% /run/dev/vda1        99G  4.2G   90G   5% /tmpfs           5.7G     0  5.7G   0% /dev/shmtmpfs           5.0M     0  5.0M   0% /run/locktmpfs           1.2G  4.0K  1.2G   1% /run/user/0

· 然后输入 ufw status 可以看到默认防火墙是关闭的,因此我们就不需要额外再去配置端口开放相关的配置,只要在华为云安全组配置端口开放就可以了

root@flexusx-ebe8:~# ufw statusStatus: inactive

docker 环境的安装

· 然后进行 docker 容器的安装,安装最新版本的 docker

· 这里因为 docker 现在已经无法直接通过网络安装,所以我们通过离线安装的方式安装 docker 环境

· 从官网下载离线包

https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/

 

· 如图所示,把离线包传到服务器上,进行安装

dpkg -i *.deb

· 查看安装的 docker 版本

root@flexusx-ebe8:/home/docker# docker -vDocker version 27.1.2, build d01f264

· 至此 docker 容器环境安装完毕

docker-compose 安装

· docker 容器安装完毕后,开始安装 docker-compose

· https://github.com/docker/compose/tags离线下载 docker-compose 的包

· 因为我是 x86-64 的环境,所以从中找到 docker-compose-linux-x86_64 进行下载

· 下载完毕后上传到服务器,然后执行 sudo cp -f docker-compose-linux-x86_64 /usr/local/bin/docker-compose

· 然后授予可执行权限,sudo chmod +x /usr/local/bin/docker-compose

· 查看 docker-compose 版本

root@flexusx-ebe8:/# sudo docker-compose -vDocker Compose version v2.29.2

· 这样 docker-compose 就安装完毕了

什么是 ERPnext

· ERPNext 是一个开源的企业资源计划(ERP)系统,旨在帮助企业管理各种业务流程。它的设计灵活、模块化,适用于各类行业,包括制造业、零售、服务业、教育和医疗等。ERPNext 提供了一整套功能丰富的模块,用于财务、采购、库存、生产、人力资源、销售、客户关系管理(CRM)等,帮助企业集中管理和优化其日常运营。

ERPNext 的特点

· 完全开源:ERPNext 是完全免费的开源软件,用户可以根据自身需求自由修改和扩展系统。

· 模块化设计:不同模块可以独立运行或无缝集成,满足不同业务的个性化需求。

· 云端或本地部署:ERPNext 支持在云端或本地服务器上部署,适应不同企业的需求。

· 多行业支持:不仅适合制造业、零售、分销等传统行业,还支持教育、医疗等垂直领域。

· 灵活定制:系统支持通过低代码/无代码平台进行业务流程的定制,适合各种规模的企业。

部署 ERPNext

· 输入https://github.com/frappe/erpnext,查看 ERPNext 项目 

· 找到容器化安装 

· 输入https://github.com/frappe/frappe_docker 

· 把包下载下来 

· 把包传到华为云服务器上,并解压

root@flexusx-ebe8:/home/docker/erpnext/frappe_docker-main# lsCODE_OF_CONDUCT.md  CONTRIBUTING.md       development      docs         images               LICENSE    pwd.yml    requirements-test.txt  setup.cfgcompose.yaml        devcontainer-example  docker-bake.hcl  example.env  install_x11_deps.sh  overrides  README.md  resources              tests

· 输入 docker-compose -f pwd.yml up -d 

[+] Running 17/17 ✔ Network frappe_docker-main_default            Created                                                                                                                         0.0s ✔ Volume "frappe_docker-main_redis-queue-data"  Created                                                                                                                         0.0s ✔ Volume "frappe_docker-main_db-data"           Created                                                                                                                         0.0s ✔ Volume "frappe_docker-main_sites"             Created                                                                                                                         0.0s ✔ Volume "frappe_docker-main_logs"              Created                                                                                                                         0.0s ✔ Volume "frappe_docker-main_redis-cache-data"  Created                                                                                                                         0.0s ✔ Container frappe_docker-main-redis-queue-1    Started                                                                                                                         2.8s ✔ Container frappe_docker-main-websocket-1      Started                                                                                                                         2.7s ✔ Container frappe_docker-main-db-1             Started                                                                                                                         3.1s ✔ Container frappe_docker-main-create-site-1    Started                                                                                                                         2.8s ✔ Container frappe_docker-main-queue-short-1    Started                                                                                                                         2.9s ✔ Container frappe_docker-main-scheduler-1      Started                                                                                                                         3.1s ✔ Container frappe_docker-main-configurator-1   Started                                                                                                                         2.6s ✔ Container frappe_docker-main-queue-long-1     Started                                                                                                                         3.1s ✔ Container frappe_docker-main-backend-1        Started                                                                                                                         2.9s ✔ Container frappe_docker-main-redis-cache-1    Started                                                                                                                         2.8s ✔ Container frappe_docker-main-frontend-1       Started                                                                                                                         1.0sroot@flexusx-ebe8:/home/docker/erpnext/frappe_docker-main#

· 查看 ERPNext 运行状态,docker ps

root@flexusx-ebe8:/home/docker/erpnext/frappe_docker-main# docker psCONTAINER ID   IMAGE                     COMMAND                  CREATED          STATUS                    PORTS                                       NAMES7e548d542365   frappe/erpnext:v15.35.0   "nginx-entrypoint.sh"    17 minutes ago   Up 17 minutes             0.0.0.0:8080->8080/tcp, :::8080->8080/tcp   frappe_docker-main-frontend-19f5c9cc2f842   frappe/erpnext:v15.35.0   "bench schedule"         17 minutes ago   Up 17 minutes                                                         frappe_docker-main-scheduler-1c1da0efbf449   frappe/erpnext:v15.35.0   "bench worker --queu…"   17 minutes ago   Up 17 minutes                                                         frappe_docker-main-queue-long-1563975b5ce00   mariadb:10.6              "docker-entrypoint.s…"   17 minutes ago   Up 17 minutes (healthy)   3306/tcp                                    frappe_docker-main-db-1a4fef11a4fba   frappe/erpnext:v15.35.0   "bench worker --queu…"   17 minutes ago   Up 17 minutes                                                         frappe_docker-main-queue-short-1b06140a1fc55   redis:6.2-alpine          "docker-entrypoint.s…"   17 minutes ago   Up 17 minutes             6379/tcp                                    frappe_docker-main-redis-cache-1c763343e0777   frappe/erpnext:v15.35.0   "/home/frappe/frappe…"   17 minutes ago   Up 17 minutes                                                         frappe_docker-main-backend-10e79d598282b   redis:6.2-alpine          "docker-entrypoint.s…"   17 minutes ago   Up 17 minutes             6379/tcp                                    frappe_docker-main-redis-queue-196fbf4799f85   frappe/erpnext:v15.35.0   "node /home/frappe/f…"   17 minutes ago   Up 17 minutes                                                         frappe_docker-main-websocket-1

· 此时 docker 部署 ERPNext 完毕,但还需要去华为云安全组开放端口

配置 Flexus 云服务器 X 实例安全组

· 经过上面部署 ERPNext 服务,这时候服务是已经部署完毕了,但是我们还没法通过外网进行访问,还需要对 Flexus 云服务器 X 安全组的配置进行修改

· 进入安全组的配置页面 

· 新建安全组 

· 这里我们开放 8080 端口

· 然后加入新建的安全组 

· 这样我们的实例的端口也就开放成功了

开始使用 ERPNext

· 访问 http://弹性公网 ip:8080/#login 

· 默认账号密码(用户名:Administrator,密码:admin)

· 然后一步步配置 

· 进入主页 

· 至此华为云 Flexus X 实例 docker 部署 ERPnext 构建属于自己的企业资源规划系统完成

欢迎大家一起加入华为云!

Apipost 私有化火热进行中

评论