This project uses the following technologies:
- Docker CE (
version 18.05.0-ce, build f150324
) - PHP (
version 7.2.7
) - Laravel (
version 5.6.27
) - MariaDB (
version 10.3.17
) โ There are currently issues with mysql 8+ and Laravel - Redis (
version 4.0.10
)
Tested on Ubuntu 16.04 LTS and Ubuntu 18.04
I recommend running this project on a Linux distro as the latest version of Docker For Windows
has a pretty serious memory leak when deploying a stack (like in this project).
The only thing required to run this project is Docker CE. If you're on Windows (you shouldn't be)
simply go to the following url, create an account and download for free.
If you're on ArchLinux (looking at you Guillaume) then have fun following this link.
If you're on a normal Debian Linux installation then do the following:
$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
$ sudo apt-get update
$ sudo apt-get install docker-ce
$ sudo usermod -aG docker $USER
Restart the VM. If you're not in a VM, logout and log back in.
$ docker --version
Docker version 18.05.0-ce, build f150324
$ git clone http://github.com/twotimesagnew/gti619.git
$ cd /path/to/project
ui:
volumes:
- type: bind
source: /path/to/gti619/ui
target: /var/www/html
DO NOT TOUCH TARGET, ONLY SOURCE
$ docker swarm init
$ docker stack deploy -c local_stack.yml gti
The installation will take a long time the first time because all of the images need to be downloaded. You can
track the progress by running watch docker images
. Once you have mariadb, redis, laravel and phalcon, they
will start running composer install which will install the dependencies for both frameworks. This will also
take a long time. Expect to wait ~10 mins the first time. Re-deployments after the first one will be
almost instantaneous.
$ docker service ls
All services should be showing 1/1
in the Replicas field
$ docker service logs <service_name> -f
This will show you all the stdout
and stderr
output.
For example, docker service logs gti_ui -f
will show everything happening as if you were checking laravel logs
mysql : localhost:3306
php : localhost:8080
redis : localhost:6379
Since we are binding our code, if you change something in your project, you do not need
to re-deploy the stack. The changes will be applied automatically. Simply refresh the webpage and you should
see your changes reflected.
The only times you will need to redeploy will be if you modify something in the local_stack.yml
file. For
example, if you want to test in a production environment, you could set APP_ENV: production
and you would
need to rebuild.