[英]Using laradock docker configuration for developing
Hello there we am currently developing a Laravel application. 你好我们正在开发一个Laravel应用程序。 I want all my team members to work locally so we decided to use Docker for our local development environment.
我希望我的所有团队成员都能在本地工作,所以我们决定将Docker用于我们的本地开发环境。 I did a little research and there is a project called laradock.
我做了一点研究,有一个名为laradock的项目。 After installing it I am supposed to go to http://localhost and the project should run.
安装后我应该去http:// localhost ,项目应该运行。 But I get this:
但我明白了:
I am using apache2 and mysql 我正在使用apache2和mysql
Check you apache configuration (in my case [laradock_folder]/apache2/sites/default.apache.conf
file). 检查你的apache配置(在我的案例中
[laradock_folder]/apache2/sites/default.apache.conf
文件)。
You should have DocumentRoot /var/www/public/
. 你应该有
DocumentRoot /var/www/public/
。 I suppose you have /var/www/
instead 我想你有
/var/www/
而不是
Go to ./laradock/.env
and search for APACHE_DOCUMENT_ROOT
then edit that line to this: 转到
./laradock/.env
并搜索APACHE_DOCUMENT_ROOT
然后将该行编辑为:
APACHE_DOCUMENT_ROOT=/var/www/public
For this change to take effect, you have to: 要使此更改生效,您必须:
docker-compose build apache2
docker-compose build apache2
docker-compose up
docker-compose up
As mentioned by simonvomeyser on GitHub this is a recent addition which had the same effect as rodion.arr's solution but this way you can leave the original config files untouched and use the .env
file to store all your project related configurations. 正如simonvomeyser在GitHub上所提到的,这是最近添加的,与rodion.arr的解决方案具有相同的效果,但这样您可以保持原始配置文件不变,并使用
.env
文件来存储所有与项目相关的配置。 Obviously, since this is a docker config change, you have to rebuild and restart your container, as rodion-arr and 9bits ponted it out in the same thread. 显然,由于这是一个docker配置更改,你必须重建并重新启动你的容器,因为rodion-arr和9bits在同一个线程中进行了调整。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.