This guide describes how to use docker and docker-compose in order to start Billrun application.
The docker install the full stack of BillRun: MongoDB database, Nginx web-server, PHP and the application itself.
You can find the docker sources under BillRun project docker/billrun-docker.
If you don't have git or docker, you'll need to install them before the previous command.
sudo apt-get update
sudo apt -y install git docker.io docker-compose
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y git docker-ce docker-ce-cli containerd.io
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
sudo systemctl start docker
Now that you've git, you'll need to fork BillRun repository into your local environment that the docker you'll run inside:
export BILLRUN_DIR=/var/www/billrun/
sudo git clone https://git.bill.run/sdoc/billrun.git $BILLRUN_DIR
From within the docker directory you can execute the run_docker.sh
script
cd $BILLRUN_DIR/docker/billrun-docker/
sudo ./run_docker.sh
Create the log file in order to overcome permission issue and crash
DEBUG_LOG_DIR=../../logs/container
mkdir ${DEBUG_LOG_DIR} -p
touch ${DEBUG_LOG_DIR}/debug.log && chmod 666 ${DEBUG_LOG_DIR}/debug.log
Build the image and run start it
sudo docker-compose -f docker-compose-php74.yml up --build --detach
Start the docker-compose stack only (without building it)
sudo docker-compose -f docker-compose-php74.yml up --detach
Stop the stack
sudo docker-compose -f docker-compose-php74.yml stop
Delete the docker stack including all related containers and their volumes
sudo docker-compose -f docker-compose-php74.yml down -v