docker安装octobercms

资源准备:

安装步骤:

  1. docker版的composer, 将其仓库地址替换为中国. Dockerfile tip: docker build -t mycomposer .
  2. mkdir ~/laradockProject
  3. cd ~/laradockProject
  4. git clone https://github.com/laradock/laradock.git
  5. cd ~/laradockProject/laradock
  6. cp env-exampl .env
  7. vi .env PP_CODE_PATH_HOST=../myoctober MYSQL_VERSION=5.7
  8. docker-compose build mysql
  9. cd ~/laradockProject/laradock/nginx/sites
  10. cp laravel.conf.example myoctober.conf
  11. vi myoctober.conf server_name myoctober.test; root /var/www;
  12. docker-compose up -d nginx mysql phpmyadmin redis workspace
  13. docker-exec -it laradock_mysql_1 bash
  14. mysql -u root -p root | create database myoctober
  15. 退出数据库, 退出mysql-docker
  16. sudo vi /etc/hosts | add 127.0.0.1 myoctober.test
  17. docker run --rm --interactive --tty --volume $PWD:/app mycomposer create-project october/october myoctober
  18. vi ~/laradockProject/myoctober/config/cms.php ‘disableCoreUpdates’ => true,
  19. cd ~/laradockProject/myoctober
  20. docker run –rm –interactive –tty –volume $PWD:/app mycomposer update
  21. vi ~/laradockProject/myoctober/config/database.php 设置数据库配置信息(user: root pass:root)
  22. 前台: http://myoctober.test 后台: http://myoctober.test/backend/backend/auth/signin 默认用户名: admin 密码: admin

相关资料

composer-安装
官方安装文档-composer
docker-mysql启动错误

2018年08月03日21:26:32 更新 项目移植测试

  1. https://github.com/helloMJW/laradock.git #克隆项目
  2. git chekcout octobercms #切换到分支octobercms
  3. docker-compose up -d nginx mysql workspace #[laradock]目录操作, 启动后laradoct同级目录有myoctober目录.
  4. docker run –rm –interactive –tty –volume $PWD:/var/www composer create-project october/october ./ #[myoctober]目录下操作
  5. docker exec -it laradock_workspace_1 bash # 进入容器中
  6. php artisan october:install #[laradock_workspace_1]容器中操作, octobercms环境及程序安装完成.
  7. vi /etc/hosts 127.0.0.1 octobercms.test #本地HOSTS配置
  8. 首页访问 octobercms.test 后台访问 octobercms.test/backend/backend/auth/signin