Skip to content

MVP for climateStoriesBank.org, a b2b web app about global warming

Notifications You must be signed in to change notification settings

EmilienLetestu/projectUn

Repository files navigation

Projet Un

Build

  • Insight :

  • Blackfire :

Docker usage

Once you've installed Docker, time to build the project.

This project use Docker environment files in order to allow the configuration according to your needs, this way, you NEED to define a .env file in order to launch the build.

In order to perform better, Docker can block your dependencies installation and return an error or never change your php configuration, we recommand to delete all your images/containers before building the project

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker rmi $(docker images -a -q) -f

Note that this command can take several minutes before ending

Once this is done, let's build the project.

cp .env.dist .env

Update the informations linked to Docker then use Docker-Compose :

docker-composer up -d --build

Then you must use Composer in order to launch the application :

docker exec -it project_php-fpm sh

# Use Composer inside the container for better performances.
composer install
composer clear-cache
composer dump-autoload --optimize --classmap-authoritative --no-dev

# Configure BDD
./bin/console d:s:c # for classic users

# Fixtures
./bin/console d:f:l -n

Once this is done, access the project via your browser :

  • Dev :
http://localhost:port/

For the production approach, you must update the .env file and change the APP_ENV and APP_DEBUG keys.

  • Prod :
http://localhost:port/

If you need to perform some tasks:

docker exec -it project_php-fpm sh

Once in the container:

# Example for clearing the cache
./bin/console c:c --env=prod || rm -rf var/cache/*

Please note that you MUST open a second terminal in order to keep git ou other commands line outside of Docker

PHP CLI

cd core
php bin/console s:r || ./bin/console s:r || make serve

Then access the project via your browser:

http://localhost:8000

The commands listed before stay available and needed for this approach

Tests coverage

This project is completely tested and followed by PHPUnit and Behat, this way, our code is easily maintainable and upgradable, here's is the details of the coverage :

In order to launch the tests, here's the process :

Be sure to have build the containers/services

docker exec -it project_php-fpm sh
  • PHPUnit
phpunit -v
  • Behat
vendor/bin/behat

Once this is done, you should see the different results of tests.

About

MVP for climateStoriesBank.org, a b2b web app about global warming

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published