This project is a fork of the EspoCRM Github repository. It adds additional functionality to set up a continuous integration, delivery, and deployment (CI/ CD) process, using Docker and Github actions.
The project uses Github actions to define and run the workflow. The workflow is specified in the .github/workflows/main.yml
file. It runs tests, builds images, and deploys the images to the server:
- Run unit tests.
- Run integration tests.
- Build Docker images using
docker-compose.ci.yml
, and save them as Github packages. - Pull the built images from Github packages into the server.
- Build and run containers based on the pulled images using
docker-compose.prod.yml
. This runs the containers:espocrm
,mysql
, andespocrm-daemon
.
The following files have been added which are used for building Docker images and running Docker containers:
docker-compose.dev.yml # Used locally for development
docker-compose.ci.yml # Used in Github actions workflow on the Github server
docker-compose.prod.yml # Used in Github actions workflow to run containers on the server
docker-daemon.sh # Used for running the espocrm-daemon container
docker-entrypoint.sh # Used for running the mysql and espocrm containers
docker-websocket.sh
Dockerfile # Used for building images
These files are largely based on the files in the espocrm-docker Github repository.
Here is an example of how to set up a server for the project:
-
Set up a remote server with SSH access, e.g. with DigitalOcean or another provider.
-
Install Docker if not already installed.
-
Create a user and add them to the
sudo
anddocker
groups:adduser myuser usermod -aG sudo myuser usermod -aG docker myuser
-
Enable SSH access by copying the key from
root
:rsync --archive --chown=myuser:myuser ~/.ssh /home/myuser
-
After verifying that you can SSH in as the new user, disable root access:
sudo vim /etc/ssh/sshd_config # Set PermitRootLogin to no sudo systemctl restart sshd # Restart the daemon
-
Set up a firewall:
ufw allow OpenSSH ufw enable
-
Create a user for Github actions continuous integration, and add them to the
sudo
anddocker
groups:adduser githubciuser usermod -aG sudo githubciuser usermod -aG docker githubciuser
-
Generate SSH keys for the new user (leave the password blank):
ssh-keygen -t ed25519 cat <path/to/public/key> >> ~/.ssh/authorized_keys
Save the username and private key as the Github secrets:
SSH_USER
andPRIVATE_KEY
.
The project uses Github secrets to save and retrieve private information. To run the project, the following secrets to be set:
ESPOCRM_ADMIN_USERNAME
andESPOCRM_ADMIN_PASSWORD
- the username and password of the admin user in EspoCRM.ESPOCRM_DATABASE_PASSWORD
- mySQL database password.ESPOCRM_SITE_URL
- the URL of the site, e.g.http://123.45.678.90:8080
IP_ADDRESS
- the IP address of the serverNAMESPACE
- the Github organisation or username which the repo is inPERSONAL_ACCESS_TOKEN
- a Github personal access token, with permissions to write, read, and delete packagesSSH_USER
andPRIVATE_KEY
- name and private SSH key pf a user on the server (the user should be part of thedocker
group)
To start the workflow, push changes to the master
branch:
git push
This starts the workflow described above - it runs tests, builds the new images, pulls the new images to the server, and starts up mysql
, espocrm
, and espocrm-daemon
containers.
Note that this creates new images on the server, so occasionally it is good to remove old images to avoid taking up a lot of space. This can be done by accessing the server via SSH and running docker image prune
.
The Docker containers can be built and run locally using the docker-compose.dev.yml
file:
docker compose -f docker-compose.dev.yml up --force-recreate -d
Add the --renew-anon-volumes
tag to recreate anonymous volumes instead of retrieving data from the previous containers.
EspoCRM is an Open Source CRM (Customer Relationship Management) software that allows you to see, enter and evaluate all your company relationships regardless of the type. People, companies or opportunities – all in an easy and intuitive interface.
It's a web application with a frontend designed as a single page application and REST API backend written in PHP.
Download the latest release from our website. Release notes and release packages are available at Releases on GitHub.
You can try the CRM on the online demo.
- PHP 8.0 and later;
- MySQL 5.7 (and later), or MariaDB 10.2 (and later).
For more information about server configuration see this article.
See the documentation for administrators, users and developers.
Create a GitHub issue or post on our forum.
See installation instructions:
See the developer documentation.
We highly recommend using IDE for development. The backend codebase follows SOLID principles, utilizes interfaces, static typing and generics. We recommend to start learning EspoCRM from the Dependency Injection article in the documentation.
Before we can merge your pull request, you need to accept our CLA here. It's very simple to do.
Branches:
- fix – upcoming maintenance release; minor fixes should be pushed to this branch;
- master – develop branch; new features should be pushed to this branch;
- stable – last stable release.
If you want to improve existing translation or add a language that is not available yet, you can contribute on our POEditor project. See instructions here.
Changes on POEditor are usually merged to the GitHub repository before minor releases.
If you have a question regarding some features, need help or customizations, want to get in touch with other EspoCRM users, or add a feature request, please use our community forum. We believe that using the forum to ask for help and share experience allows everyone in the community to contribute and use this knowledge later.
EspoCRM is published under the GNU GPLv3 license.