Giter Site home page Giter Site logo

danke-php72's Introduction

蛋壳本地开发环境搭建

*** 目前为初版可能会遇到各种问题,希望大家加入进来一起完善 ***

首先确保你的电脑已经安装了docker环境

可以查看一下 MAC 安装 docker 环境的方法 https://www.jianshu.com/p/9142187552db

第一步拉取镜像文件

docker pull registry.cn-beijing.aliyuncs.com/aliyun-php/danke_php72

第二步运行docker 容器

docker run --restart always --name php7.2  -p 80:80 -v /danke/:/var/www/ -itd  php7.2:latest
--restart always 容器自动重启

--name 是容器名称随意定

-p 80:80 指定本地80端口指向容器的80端口 (如果本地有80端口被占用先停掉本地80端口)

-v /danke/:/var/www/  将本地 /danke/ 目录挂载到 容器的/var/www/目录下 (本地目录根据自己项目位置自定义)

第三步定义本地 hosts文件

127.0.0.1 dev.test.laputa.com

127.0.0.1 dev.test.crm_feedback.com

默认容器里有2个nginx conf文件  分别是laputa 和 crm_feedback项目的

config文件自己可以根据自己需求随意更改

进入容器 执行 composer update -vvv

docker exec -it php7.2 bash
如果已经执行过,无需在执行
cd /var/www/项目目录
composer update -vvv

最后一步

打开浏览器 访问 dev.test.crm_feedback.com 或者 dev.test.laputa.com

如果能正常访问则恭喜你环境搭建成功!

【注意】 在本地增加Class或者引入新的Composer包后都推荐执行一次

composer dumpautoload; php artisan clear-compiled; php artisan ide-helper:generate -M; php artisan ide-helper:models -n; php artisan optimize;

danke-php72's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.