Ensure you have installed docker and docker-compose
$ docker --version
Docker version 17.06.2-ce, build cec0b72
$ docker-compose --version
docker-compose version 1.16.1, build 6d1ac21
Clone the project
git clone git@github.com:TIS2017/Nobelisti.git
Build and run the container as daemon
docker-compose up --build -d
Composer install & create database
docker-compose exec php bash
composer install
php bin/console doctrine:migrations:migrate
Change permissions so symfony can save cache, logs & sessions.
sudo chown :33 src/var -R
Check the app at localhost:8080/app_dev.php.
Stop the container politely
docker-compose stop
We have a separate docker-composer file for production, to install the production requirements run
docker-compose -f docker-compose.prod.yml up --build -d
If you do not want to use docker in production, the minimal requirements for this applications are
Database client version: libmysql - 10.1.26-MariaDB
PHP version: 7.0
A CRON bundle was installed to help run CRON tasks in the production enviroment. To create a cron job, run:
docker-compose exec php bash
php bin/console cron:create
The following commands for sending emails are available:
email:delete:obsolete-registrations
- Deletes expired unclaimed registrations from the database, emptying space for other attendees.email:send:attendee-notification
- Sends reminders to all attendees that an upcoming event is nearing. Should be executed at least once a day.email:send:organizer-notification
- Sends information about registered users to organizers. Should be executed once a day.email:send:registration-open
- Sends notifications that a new event has become available for registration. Should be executed at least once a day.Setting up CRON tasks has to be done manually, either using CRON externally or using the CRON package available here: https://github.com/Cron/Cron
The commands have to be executed from the bin folder.
To install and setup, just follow the provided instructions on the CRON github page.
docker-compose exec php php vendor/phpunit/phpunit/phpunit
Run docker-compose run php ./csfix
script before each commit!
$ docker-compose exec php bash
ERROR: No container found for php_1
You have to run docker-compose up -d
in advance or run docker-compose up
simultaneously in other terminal.
RuntimeException
Unable to write in the cache directory (/var/www/symfony/var/cache/dev)
Do step 4 again.
ClassNotFoundException
docker-compose exec php bash
composer dumpautoload
in the root directorydocker-compose exec php bash
php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate
docker-compose exec php bash
php bin/console admin:create-superuser email@email.com password