Skip to content

Commit

Permalink
upgrade docker-compose to v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmoudz committed Apr 5, 2018
1 parent 0635303 commit a0c5ef7
Show file tree
Hide file tree
Showing 10 changed files with 236 additions and 305 deletions.
32 changes: 15 additions & 17 deletions DOCUMENTATION/content/documentation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,18 +478,14 @@ composer create-project laravel/laravel my-cool-app "5.2.*"
For more about the Laravel installation click [here](https://laravel.com/docs/master#installing-laravel).


3 - Edit `docker-compose.yml` to Map the new application path:
3 - Edit `.env` to Map the new application path:

By default, Laradock assumes the Laravel application is living in the parent directory of the laradock folder.

Since the new Laravel application is in the `my-cool-app` folder, we need to replace `../:/var/www` with `../my-cool-app/:/var/www`, as follow:

```yaml
application:
image: tianon/true
volumes:
- ../my-cool-app/:/var/www
...
```dotenv
APP_CODE_PATH_HOST=../my-cool-app/
```
4 - Go to that folder and start working..

Expand Down Expand Up @@ -1525,14 +1521,14 @@ Quick Setup giude, (we recommend you check their docs)
You can use the d4m-nfs solution in 2 ways, one is using the Laradock built it integration, and the other is using the tool separatly. Below is show case of both methods:


#### B.1: using the built in d4m-nfs integration
### B.1: using the built in d4m-nfs integration

In simple terms, docker-sync creates a docker container with a copy of all the application files that can be accessed very quickly from the other containers.
On the other hand, docker-sync runs a process on the host machine that continuously tracks and updates files changes from the host to this intermediate container.

Out of the box, it comes pre-configured for OS X, but using it on Windows is very easy to set-up by modifying the `DOCKER_SYNC_STRATEGY` on the `.env`

##### Usage
#### Usage

Laradock comes with `sync.sh`, an optional bash script, that automates installing, running and stopping docker-sync. Note that to run the bash script you may need to change the permissions `chmod 755 sync.sh`

Expand All @@ -1547,22 +1543,24 @@ Laradock comes with `sync.sh`, an optional bash script, that automates installin
DOCKER_SYNC_STRATEGY=native_osx
```

2) Install the docker-sync gem on the host-machine:
3) set `APP_CODE_PATH_CONTAINER=/var/www` to `APP_CODE_PATH_CONTAINER=/var/www:nocopy` in the .env file

4) Install the docker-sync gem on the host-machine:
```bash
./sync.sh install
```
3) Start docker-sync and the Laradock environment.
5) Start docker-sync and the Laradock environment.
Specify the services you want to run, as you would normally do with `docker-compose up`
```bash
./sync.sh up nginx mysql
```
Please note that the first time docker-sync runs, it will copy all the files to the intermediate container and that may take a very long time (15min+).
4) To stop the environment and docker-sync do:
6) To stop the environment and docker-sync do:
```bash
./sync.sh down
```

##### Setting up Aliases (optional)
#### Setting up Aliases (optional)

You may create bash profile aliases to avoid having to remember and type these commands for everyday development.
Add the following lines to your `~/.bash_profile`:
Expand All @@ -1576,7 +1574,7 @@ alias devdown="cd /PATH_TO_LARADOCK/laradock; ./sync.sh down"
Now from any location on your machine, you can simply run `devup`, `devbash` and `devdown`.


##### Additional Commands
#### Additional Commands

Opening bash on the workspace container (to run artisan for example):
```bash
Expand All @@ -1592,7 +1590,7 @@ Removing and cleaning up the files and the docker-sync container. Use only if yo
```


##### Additional Notes
#### Additional Notes

- You may run laradock with or without docker-sync at any time using with the same `.env` and `docker-compose.yml`, because the configuration is overridden automatically when docker-sync is used.
- You may inspect the `sync.sh` script to learn each of the commands and even add custom ones.
Expand All @@ -1609,7 +1607,7 @@ Visit the [docker-sync documentation](https://github.com/EugenMayer/docker-sync/

<br>

#### B.2: using the d4m-nfs tool
### B.2: using the d4m-nfs tool

[D4m-nfs](https://github.com/IFSight/d4m-nfs) automatically mount NFS volume instead of osxfs one.

Expand Down Expand Up @@ -1751,4 +1749,4 @@ Example:
```bash
WORKSPACE_NPM_REGISTRY=https://registry.npm.taobao.org
WORKSPACE_COMPOSER_REPO_PACKAGIST=https://packagist.phpcomposer.com
```
```
4 changes: 2 additions & 2 deletions DOCUMENTATION/content/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ We recommend using a Docker version which is newer than 1.13.
cp env-example .env
```

You can edit the `.env` file to chose which software's you want to be installed in your environment. You can always refer to the `docker-compose.yml` file to see how those variables are been used.
You can edit the `.env` file to choose which software's you want to be installed in your environment. You can always refer to the `docker-compose.yml` file to see how those variables are been used.

Depending on the host's operating system you may need to change the value given to `COMPOSE_FILE`. When you are running Laradock on Mac OS the correct file separator to use is `:`. When running Laradock from a Windows environment multiple files must be separated with `;`.

Expand All @@ -173,7 +173,7 @@ In this example we'll see how to run NGINX (web server) and MySQL (database engi
docker-compose up -d nginx mysql
```

**Note**: The `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command. If you couldn't find them running then you need specify them as follow: `docker-compose up -d nginx php-fpm mysql workspace`.
**Note**: The web servers `nginx`, `apache`.. all depend on `php-fpm`, means if you just run, them they will automatically run the `php-fpm` for you, so no need to specify them in the `up` command. If you don't see them running then you may need run them as follow: `docker-compose up -d nginx php-fpm mysql...`.


You can select your own combination of containers from [this list](http://laradock.io/introduction/#supported-software-images).
Expand Down
2 changes: 1 addition & 1 deletion DOCUMENTATION/content/introduction/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ cp env-example .env
3 - Run your containers:

```shell
docker-compose up -d nginx mysql redis beanstalkd
docker-compose up -d nginx mysql phpmyadmin redis workspace
```

4 - Open your project's `.env` file and set the following:
Expand Down
9 changes: 0 additions & 9 deletions docker-compose.dev.yml

This file was deleted.

10 changes: 5 additions & 5 deletions docker-compose.sync.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
version: '2'
version: '3'

services:

### Applications Code Container #############################

applications:
image: tianon/true
volumes:
- applications-sync:/var/www:nocopy # nocopy is required
# applications:
# image: tianon/true
# volumes:
# - applications-sync:/var/www:nocopy # nocopy is required

### Volumes Setup #############################################

Expand Down
Loading

0 comments on commit a0c5ef7

Please sign in to comment.