6

I'm trying to make working out laradock (docker+laravel) following: https://github.com/LaraDock/laradock instructions

I installed docker + cloned laradock.git laradock folder is located at /myHD/...path../www/laradock at the same level I have my laravel projects /myHD/...path../www/project01

I edited laradock/docker-compose.xml

### Laravel Application Code Container ######################

volumes_source:
    image: tianon/true
    volumes:
        - ../project01/:/var/www/laravel

After this, bu I'm not sure it this is how to reload correctly after editing docker-file, I did:

 docker-compose up -d nginx mysql

now since I have a nginx error 404 not found: how can I debug the problem ?

Additional info:

I entered the machine via bash:

 docker-compose exec  --user=laradock workspace bash

but I cant find

 /etc/nginx/... path (nginx folder doesn't exists !?!?) 
sayan saha
  • 91
  • 2
  • 8
koalaok
  • 5,075
  • 11
  • 47
  • 91
  • Hi @koalaok, try using the below command to access your Nginx container; ```docker-compose exec nginx bash``` – Nishant Shrivastava Mar 13 '17 at 18:39
  • 1
    For me, the problem was that I should have left `APP_CODE_PATH_HOST=../` as it was in `~/laradock/.env` because in my `~/laradock/nginx/sites/default.conf` I had set `root /var/www/tt/public;`. – Ryan Jul 09 '18 at 18:22

1 Answers1

2

Guessing your nginx is not located in the workspace container, it resides on a separate container, You've executed the following: docker-compose up -d nginx mysql

That would probably only run nginx and mysql containers, not your php-fpm container. Also the path to you volume is important as the configurations in you nginx server depends on this.

To run php-fpm, add php-fpm or something similar to the docker-compose up command, check out what this is called in your docker-compose.yaml file e.g
docker-compose up -d nginx mysql phpfpm

To assess you nginx container first of all execute

 `docker ps -a`

From the list, look for the ID of your nginx container, before running

docker exec -it <container-id> bash

This should then give you assess to your nginx container to make the required changes.

Or without directly accessing the container, simply make changes in the nginx configuration file, look for 'server' and the 'root' change the root from var/www/laravel/public to the new directory /project01/public.

Execute the command to bring down your containers

docker-composer down

Star over again with

docker-compose up -d nginx mysql phpfpm 

Give it a go

dev_a.y
  • 133
  • 2
  • 7
  • thanks for your answer. But: phpfpm is php-fpm, also your solution is not working for me. – koalaok Oct 15 '16 at 16:40
  • 1
    Yh, which ever way (phpfpm or php-fpm) whichever way its written. Try sudo chmod -R 775 on your storage directory in Laravel – dev_a.y Oct 15 '16 at 17:28