- Francken Docker Environment
This repository can be used to setup a development environment that runs on
A shell script =init.sh= is included which, once you execute it, will setup our
environment for you which includes setting an =.env= file, installing dependencies
(both composer and npm), generating css, setting an encryption key and finally
starting a nginx server so you can start working on the website and see it on
Once everything is working you should check the documentation on the main
repository to find some tips on how to work with our application.
There are 4 requirements that you will need to setup yourself before you can
start using our shell script to setup your docker environment.
- [[https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/][ssh key]]
Once you've installed Docker be sure to add your user to the Docker group and
logout and login again, otherwise you will get permission errors.
** Manual instructions
The following are instructions on how to setup our environment without using the
=init.sh= file, which might be useful if you want to know more about each step
in the =init.sh= file, or if you're on Windows.
First clone this repo to some folder where you'd like to work, i.e.,
git clone email@example.com:ProfessorFrancken/Docker.git
Next clone the [[https://github.com/ProfessorFrancken/ProfessorFrancken][ProfessorFrancken/ProfessorFrancken]] repo inside the folder that's
been cloned and name it Francken (this is because our =docker-compose.yml= file
assumes the folder's name is "Francken"),
git clone firstname.lastname@example.org:ProfessorFrancken/ProfessorFrancken.git Francken
Next go to the =francken= directory and copy and rename the =.env.example= file,
cp .env.example .env
docker-compose run npm npm install
Compile our css files
docker-compose run npm npm run dev
** Install php dependencies
Next our application's php dependencies need to be installed, run
docker-compose run composer install
Next generate a private key that is used for encryption,
docker-compose run php php artisan key:generate
** Start the server
Once the composer dependencies have been installed (this might take a while
depending on your internet speed) you can start the server by running,
docker-compose up -d nginx
Next run =docker-compose run php php artisan migrate --seed= to migrate the
database. You should now be able to access the server at =localhost=.
You might get the following error when executing =docker-compose run php php artisan migrate --seed=,
SQLSTATE[HY000]  Connection refused (SQL: select * from information_schema.tables where table_schema = francken and table_name = migrations)
SQLSTATE[HY000]  Connection refused
This means that the mysql server hasn't finished initializing yet, wait a while
(≈ 1 minute) and try again.
* Stopping the server
To stop the server run =docker-compose down=.
The unit and integration tests can be run using,
docker-compose run php vendor/bin/phpunit
** Testing with coverage
Use the =test_coverage= container which includes xdebug to add collect coverage
docker-compose run test_coverage vendor/bin/phpunit
Or run humbug, a mutation testing tool
docker-compose run test_coverage vendor/bin/humbug