If you wish to run a copy of Dashtainer yourself for local development, the following steps will get you up and running within minutes.
- Docker ≥ 18.04
- Docker Compose ≥ 1.21
- Clone this repo
Docker recommends not running container as root.
For development purposes, running containers as root means any files created by the container
will show as owned by root on your host. Things like composer install
or similar will be
root owned and makes deleting them a pain.
Included is a helper script to generate a .env
file that Composer will read and apply. All
it does is pass along your user and group ID to Docker so it can create a user with the same
values. Any files then created by the container will show as owned by your current user.
- Run
./bin/init
to generate the.env
file
If you would rather the containers run as root, simply copy the included .env.dist
to .env
.
- Run
./bin/init
- Run
./bin/php composer install
to install Composer requirements - Run
./bin/php ./bin/console dashtainer:db:create
to create and seed database - Run
./bin/node npm install
to install NPM dependencies - Run
./bin/webpack
to begin the Encore daemon
- Open dashtainer.localhost/app_dev.php in Chrome
- If you do not use Chrome, you must first configure dnsmasq to forward all
*.localhost
requests to 127.0.0.1. Or just use Chrome.
- If you do not use Chrome, you must first configure dnsmasq to forward all
The default user credentials are:
- User:
[email protected]
- Password:
test123
Open adminer.dashtainer.localhost in Chrome to use Adminer with the following credentials:
- Host/Server:
mariadb
- Post:
3306
- Database Name:
dashtainer
- Database User:
dashtainer
- Database Password:
dashtainer
You may also access the database using Sequel Pro or any other MySQL-compatible GUI with:
- Host/Server:
localhost
- Post:
3600
- Database Name:
dashtainer
- Database User:
dashtainer
- Database Password:
dashtainer
Two PHP containers are created, php
and php_xdebug
. While Xdebug is installed on both
containers, only php_xdebug
has it activated by default.
To trigger Xdebug, you must set a cookie, XDEBUG_SESSION
, to xdebug
value.
Use the PhpStorm Bookmarklets
generator to create your Start and Stop bookmarks. The IDE key should be xdebug
.
If spinning up Docker on a Linux host, the xdebug.remote_host
value in PHP INI
use host.docker.internal
which does not currently work on Linux hosts (only Windows and MacOS for now).
To fix this, simply copy the
docker-compose.override.yml.dist
file to docker-compose.override.yml
.
- Run
./bin/php ./vendor/bin/phpunit
to run unit tests