This repository contains sample Docker development environments for EspoCRM with various PHP versions, web servers, and database configurations.
- Choose and download the desired environment directory (e.g.,
php8.5-nginx-mariadb). - Navigate to the downloaded directory and run:
docker compose up -d- Wait for the containers to start and initialize.
- Download and extract EspoCRM files into the
htmldirectory. - Open
http://localhost:8080in your browser and complete the EspoCRM installation.
docker compose up -ddocker compose up -d --build "$@"docker compose restartdocker compose downdocker compose psdocker compose logsDefault connection credentials:
- Host Name:
espocrm-mysql - Database Name: Any name you choose
- User:
root - Password:
1
Default connection credentials:
- Host Name:
espocrm-mariadb - Database Name: Any name you choose
- User:
root - Password:
1
Default connection credentials:
- Host Name:
espocrm-postgres - Database Name:
espocrm - User:
espocrm - Password:
espo_password
Add a port mapping to docker-compose.yml:
espocrm-mysql:
.....
ports:
- 8033:3306Edit the config.inc.php file in your phpMyAdmin directory:
$i++;
$cfg['Servers'][$i]['verbose'] = 'Docker: espocrm-mysql';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = 8033;
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';By default, cron jobs are executed by the daemon container. If you need to run them from the host machine instead, follow the instructions below.
Add the following cron job to execute EspoCRM scheduled tasks every minute:
* * * * * /usr/bin/docker exec --user www-data -i espocrm-php /bin/bash -c "cd /var/www/html; php cron.php" > /dev/null 2>&1Add the following service definition to your docker-compose.yml:
espocrm-websocket:
image: espocrm/espocrm
container_name: espocrm-websocket
volumes:
- ./html:/var/www/html
restart: always
entrypoint: php websocket.php
ports:
- 8081:8080Add the following settings to your data/config.php:
'useWebSocket' => true,
'webSocketUrl' => 'ws://localhost:8081',
'webSocketZeroMQSubscriberDsn' => 'tcp://*:7777',
'webSocketZeroMQSubmissionDsn' => 'tcp://espocrm-websocket:7777',Stop and remove existing containers:
docker compose down -vRebuild and start the containers:
docker compose up -d --build "$@"Execute unit tests with the following command:
/usr/bin/docker exec --user www-data phpunit --bootstrap vendor/autoload.php tests/unitExecute integration tests with the following command:
/usr/bin/docker exec --user www-data phpunit --bootstrap vendor/autoload.php tests/integration