• 欢迎访问 YZBTDIY!
  • 本站启用 TLS 加密!
  • 站点优化使用 WPJAM 的插件,万分感谢!

MeEdu Docker 安装

Linux admin 1个月前 (05-14) 56次浏览 0个评论
[root@server ~]# yum -y install git docker docker-compose supervisor
[root@server ~]# git clone https://gitee.com/myteng/MeEdu.git /MeEdu
[root@server ~]# cd /MeEdu
[root@server MeEdu]# cp .env.example .env
[root@server MeEdu]# vim .env
DB_CONNECTION=mysql
DB_HOST=meedumysql
DB_PORT=3306
DB_DATABASE=meedu
DB_USERNAME=root
DB_PASSWORD=redhat

[root@server MeEdu]# vim docker-compose.yml
  mysql:
    container_name: "meedumysql"
    image: mariadb:10.3
    expose:
      - "3306"
    volumes:
      - ./docker/mysql/conf:/etc/mysql/:rw
      - ./docker/mysql/logs:/var/log/mysql/:rw
      - ./docker/mysql/data:/var/lib/mysql/:rw
      - ./mysql/init:/docker-entrypoint-initdb.d/
    restart: always
    networks:
      - meedu-net
    environment:
      - MYSQL_ROOT_PASSWORD=redhat123

[root@server MeEdu]# docker-compose up -d
[root@server MeEdu]# docker exec -it meeduphp bash
root@6587ca4f557d:/var/www/html# php composer.phar install
root@6587ca4f557d:/var/www/html# php artisan key:generate
root@6587ca4f557d:/var/www/html# php artisan storage:link
root@6587ca4f557d:/var/www/html# chmod -R  0777 storage
root@6587ca4f557d:/var/www/html# php artisan migrate
root@6587ca4f557d:/var/www/html# php artisan install role
root@6587ca4f557d:/var/www/html# php artisan install administrator
root@6587ca4f557d:/var/www/html# php artisan install backend_menu
root@6587ca4f557d:/var/www/html# php artisan install:lock
root@6587ca4f557d:/var/www/html# exit
[root@server ~]# crontab -e
* * * * * docker exec meeduphp php /var/www/html/artisan schedule:run >> /dev/null 2>&1

[root@server ~]# vim /etc/supervisord.d/meedu.ini
[program:meedu]
process_name=%(program_name)s_%(process_num)02d
command=docker exec meeduphp php /var/www/html/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
user=root
numprocs=4
redirect_stderr=true
stdout_logfile=/MeEdu/storage/logs/supervisor.log

[root@server ~]# systemctl restart supervisord
[root@server ~]# systemctl enable supervisord
[root@server ~]# supervisorctl reread
[root@server ~]# supervisorctl update
[root@server ~]# supervisorctl restart meedu:*
[root@server ~]# php artisan passport:install

YZBTDIY , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:MeEdu Docker 安装
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址