Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using laradock docker configuration for developing

Hello there we am currently developing a Laravel application. I want all my team members to work locally so we decided to use Docker for our local development environment. I did a little research and there is a project called laradock. After installing it I am supposed to go to http://localhost and the project should run. But I get this: enter image description here

I am using apache2 and mysql

like image 257
Arnold Asllani Avatar asked Sep 11 '17 08:09

Arnold Asllani


2 Answers

tl;dr

Go to ./laradock/.env and search for APACHE_DOCUMENT_ROOT then edit that line to this:

APACHE_DOCUMENT_ROOT=/var/www/public

Things to do after the change

For this change to take effect, you have to:

  • Rebuild the container: docker-compose build apache2
  • Restart the containers: docker-compose up

Explanation

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. 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.

like image 76
3 revs Avatar answered Nov 09 '22 06:11

3 revs


Check you apache configuration (in my case [laradock_folder]/apache2/sites/default.apache.conf file).

You should have DocumentRoot /var/www/public/. I suppose you have /var/www/ instead

like image 43
rodion.arr Avatar answered Nov 09 '22 05:11

rodion.arr