Run Laravel and Cakephp after installing docker-compose
curl https://get.docker.com | sh
sudo usermod -aG docker $USER
sudo reboot
sudo systemctl start docker
sudo systemctl enable docker
docker --version
docker environment construction
sudo curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
If you add a user to the docker group, you can execute docker commands without sudo, so add it.
Settings on Ubuntu
git clone https://github.com/LaraDock/laradock.git
cd laradock
cp env-example .env
next.Add the following 3 lines to the env file.
vi.env
DB_HOST=mysql
REDIS_HOST=redis
QUEUE_HOST=beanstalkd
Then execute the following command
sudo docker-compose up -d nginx mysql redis beanstalkd
sudo docker-compose ps
Access to the container&Preparation. If you add a user to the docker group, you can execute docker commands without sudo, so add it.
sudo docker exec -it laradock_workspace_1 bash
/var/www# apt-get update
/var/www# composer create-project "laravel/laravel=6.0.*" my-project
ls
You can check the following directories.
my-project
Then exit
Quit root user with
And the command with the following contents
cd /home/user name/Laravel/laradock
vi .env
### Paths #################################################
# Point to the path of your applications code on your host
APP_CODE_PATH_HOST=../
↓
APP_CODE_PATH_HOST=../my-project
Rewrite to.
Return to home
sudo systemctl start docker
sudo systemctl enable docker
docker --version
Log in again
sudo docker-compose up -d nginx mysql redis beanstalkd
sudo docker exec -it laradock_workspace_1 bash
And reset the screen
sudo docker-compose ps
chmod 777 storage -R
chmod 777 bootstrap/cache
docker-compose restart
Recommended Posts