http://swapp/app_dev.php/eadmin
http://swapp/app_dev.php/walks
-
extend
/etc/hosts
$ sudo vi /etc/hosts ... 127.0.0.1 swapp
-
copy docker .env file
$ copy .env.docker.dist .env.docker
-
build container once and start container immediately
$ docker-compose up --build web
- All commands have to be executed in workspace (symfony project root)
- Start all containers in background
$ docker-compose up -d web
- Install vendors, execute migrations and load fixtures (only at first time)
- Install vendors
$ docker-compose exec web php composer.phar install
- Execute migrations
$ docker-compose exec web php bin/console doctrine:migrations:migrate -n
- Load fixtures
$ docker-compose exec web php bin/console hautelook_alice:doctrine:fixtures:load -n
- Install vendors
- Activate XDebug in
.env.docker
:... PHP_XDEBUG_ENABLED: 1 ...
- PHPStorm setup:
- Settings... -> Languages & Frameworks -> PHP -> Servers: Add
- name: has to be same as PHP_IDE_CONFIG value
- port: 80
- path-mapping: path of project root in host system
- Setting -> Languages & Frameworks -> PHP -> Debug -> DBGp Proxy:
Port
: 9000
- Settings... -> Languages & Frameworks -> PHP -> Servers: Add
- Start containers:
$ docker-compose up -d web
- After clicking "Start Listening for PHP Debug Connections" in PHPStorm you can jump to web and cli breakpoints.
- To activate/deactivate XDebug simply adjust ENV-Variable
PHP_XDEBUG_ENABLED
indocker-compose.yml
and restart containers (docker-compose down && docker-compose up -d
)
- head to ./init-container.sh
- in section
Prepare PHP
change the linesh -c "echo 'upload_max_filesize = 10M'
according to your needs - if you want to allow bigger image files you have to adjust this php.ini setting as well as the
File
constraint'smaxSize
option on the imageFile property inWayPoint.php
- Execute symfony command
$ docker-compose exec web php bin/console [SF-CONSOLE-COMMAND]
- Start webpack encore
$ docker-compose exec web node_modules/.bin/encore dev-server
- Show containers and their status
$ docker-compose ps
- Container shell access
$ docker-compose exec web bash
- CLI connection to MySQL:
$ mysql -u surveythor_demo -p
- Stop services/container
$ docker-compose stop
- Stop and delete container (incl. volumes, images und networks except data volumes)
$ docker-compose down
After booting container you can start EndToEnd-Tests with:
$ docker-compose exec web vendor/bin/phpunit --filter EndToEnd
If you want to watch EndToEnd-Tests then you have to start a vnc viewer and connect to 0.0.0.0:5900 for firefox and 0.0.0.0:5901 for chrome. Maybe you have to set color depth to at least 15 bit.
Install: https://wiki.saucelabs.com/display/DOCS/Basic+Sauce+Connect+Proxy+Setup
After download and extraction start sauce labs from outside of docker (currently there is no docker container support):
$ sc-4.4.8-linux/bin/sc -u username -k api_key -i my-tun2 --se-port 4446
Start tests:
$ docker-compose exec web vendor/bin/phpunit