先上源码地址:https://github.com/celaraze/chemex

有安装介绍,基本推荐docker安装  

Linux docker安装chemex咖啡壶_资产管理系统

安装顺序

1.数据库准备

2.pull镜像

3.准备配置文件

4.创建容器

5.访问


1.数据库准备

随便准备一个mysql,只需要创建一个库,记录库的名字,此处起名chemex。

用户的话看规划,偷懒直接用root,正规的话新建个用户,授权一下chemex库的使用权限。

2.pull镜像

docker pull celaraze/chemex:latest

3.准备配置文件

配置文件要新建在linux主机中,位置无所谓,弄个目录放着就行,名字叫 .env

配置文件用于创建容器时引用其中的参数,官方的在如下目录中,

Linux docker安装chemex咖啡壶_docker_02

修改后配置文件内容如下:

[root@localhost chemex]# cat .env

# 欢迎使用 chemex,在您开始之前,请按照指引完成配置

# 基础配置:

### 数据库配置
#数据库类型,不需要修改(兼容mariadb)
DB_CONNECTION=mysql           
# 数据库地址
# DB_HOST=127.0.0.1
DB_HOST=201.192.133.166   #之前自己准备的mysql的IP
# 数据库端口号
DB_PORT=3306              #默认的
# 数据库名称
DB_DATABASE=chemex        #准备的库名,自己改
# 数据库用户名
DB_USERNAME=chemex       #准备的用户,自己改
# 数据库密码
DB_PASSWORD=chemex       #准备的密码,自己改

### 第二步:配置HTTPS
### 如果您使用HTTPS协议,请将下面两个参数修改为true
ADMIN_HTTPS=false

### 第三步:配置应用信息
# 应用名称,一般不需要修改
APP_NAME=chemex
APP_ENV=local
# 默认应用地址,在站点配置中如果没有设置,将以此生效
#APP_URL="${APP_URL}"
APP_URL=http://201.192.133.166:8000   #这里要改,docker的外部访问地址,我的mysql也是docker所以跟上面的IP是一个

# 高级配置:

# 应用密钥,可以通过执行 php artisan key:generate 重新生成
# 此项影响用户密码,一旦修改,既有的密码将全部失效,请谨慎修改
APP_KEY=base64:+Ma0Ost/YwKzeL7rgBP5zt69TD5JcZFEcMoq9xHhuuM=

# 是否开启 DEBUG 模式
# 开启后如果程序出错,将会抛出异常
# 关闭后如果程序出错,将只会给出 HTTP 错误码 500
APP_DEBUG=true

LOG_CHANNEL=stack

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

# 决定了此实例是否以demo运行(部分权限受阻)
ADMIN_DEMO=false

4.创建容器

docker run -itd --name chemex  --restart=always -p 8000:8000 \
-v /dockerdata/chemex/.env:/var/www/html/laravel/.env  \
celaraze/chemex:latest

[root@localhost chemex]# docker run -itd --name chemex  --restart=always -p 8000:8000 \
> -v /dockerdata/chemex/.env:/var/www/html/laravel/.env  \
> celaraze/chemex:latest
c4d00bfd19000a7c609bdaec9927789fc5aae11da192416a19c85428f820b9b1

到此容器就创建好了,暂时还不能访问,需要初始化一下数据库

进入 docker 容器执行命令:
docker exec -it chemex /bin/bash 
初始化命令:
cd /var/www/html/laravel && php artisan chemex:install

实际案例:
[root@localhost chemex]# docker exec -it chemex /bin/bash 
root@c4d00bfd1900:/var/www/html/laravel# cd /var/www/html/laravel && php artisan chemex:install
正在优化配置!
   INFO  Clearing cached bootstrap files.  
  events .................................................................................................................................. 1ms DONE
  views ................................................................................................................................... 1ms DONE
  cache ................................................................................................................................... 1ms DONE
  route ................................................................................................................................... 1ms DONE
  config .................................................................................................................................. 1ms DONE
  compiled ................................................................................................................................ 1ms DONE
正在设置存储系统!
   INFO  The [public/storage] link has been connected to [storage/app/public].  
正在配置APP密钥!
   INFO  Application key set successfully.  
jwt-auth secret [A2CiH5sQ3CqBEb4rvL7HbhbEgLXwZXogOGtcToMOYBlFPYhNV6VeNKw9rwLZ8MqQ] set successfully.
正在处理数据库迁移!
   INFO  Preparing database.  
  Creating migration table ............................................................................................................... 27ms DONE
   INFO  Running migrations.  
  2016_01_04_173148_create_admin_tables ................................................................................................. 357ms DONE
  2019_12_14_000001_create_personal_access_tokens_table .................................................................................. 53ms DONE
  2020_09_07_090635_create_admin_settings_table .......................................................................................... 51ms DONE
  2020_09_22_015815_create_admin_extensions_table ........................................................................................ 74ms DONE
  2020_11_01_083237_update_admin_menu_table .............................................................................................. 14ms DONE
  2021_03_24_213912_version_3_0_0 ....................................................................................................... 789ms DONE
  2021_04_02_085513_version_3_0_1 ........................................................................................................ 78ms DONE
  2021_04_03_085513_version_3_0_2 ........................................................................................................ 44ms DONE
  2021_05_19_085513_version_3_0_10 ....................................................................................................... 37ms DONE
  2021_09_09_214313_version_3_2 .......................................................................................................... 86ms DONE
  2021_09_27_194135_version_3_2_1 ......................................................................................................... 1ms DONE
  2021_10_15_091340_version_3_3_0 ........................................................................................................ 48ms DONE
  2021_11_22_160713_version_3_4_0 ........................................................................................................ 19ms DONE
  2022_03_18_104844_version_3_5_1 ........................................................................................................ 16ms DONE
  2022_05_25_215950_version_3_5_2 ........................................................................................................ 38ms DONE
  2022_07_18_093147_version_3_7_0 ........................................................................................................ 19ms DONE
正在初始化基础数据!
   INFO  Seeding database.  
   INFO  Seeding database.  
   INFO  Seeding database.  
   INFO  Seeding database.  
   INFO  Seeding database.  
   INFO  Seeding database.  
   INFO  Seeding database.  
   INFO  Seeding database.  
   INFO  Seeding database.  
   INFO  Seeding database.  
   INFO  Seeding database.  
   INFO  Seeding database.  
   INFO  Seeding database.  
   INFO  Seeding database.  
   INFO  Seeding database.  
Admin账户已成功重置为 admin/admin
安装完成!
用户名密码都为:admin

5.访问

此时可以通过http://IP:8000访问chemex资产管理系统