Installation of Dolibarr using Docker Compose
Posted By : Shashank Raj | 30-Nov-2018
About
Dolibarr is an opensource, an all-in-one ERP & CRM platform with free software packages for small and medium companies, foundations or freelancers.
It includes different features for enterprise resource planning (ERP) & customer relationship management (CRM) but also other features for different activities.
There are several feature modules that can enable & disabled as per our need. The software is free Under GNU. As it is web-based application so it can be used over the internet. Basically, it aims to offer open source ERP & CMS for the feature for people with no technical knowledge with a simple solution.
Installation process --
-- create a directory with a name as per your choice.
$ sudo mkdir dolibarr
-- using any editor create a compose file Docker-compose.yml
$ sudo vim Docker-compose.yml
# put these lines in the compose file
version: '3'
services:
webapp:
image: nginx:1.15
depends_on:
- php
- db
networks:
- dolibarr_wp
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
- ./nginx/default.d:/etc/nginx/default.d
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./www:/var/www/html
ports:
- "80:80"
php:
image: php:7.0-fpm
restart: always
networks:
- dolibarr_wp
volumes:
- ./www:/var/www/html
db:
image: mysql:5.7
restart: always
networks:
- dolibarr_wp
volumes:
- ./db/db_data:/var/lib/mysql
- ./db/conf.d:/etc/mysql/conf.d
env_file:
- .env/db.env
networks:
dolibarr_wp:
:wq! #to save and exit
--
-- Now before building the Compose file we have to
-- Download and extract the
$ sudo mkdir www
$ cd www/
$ wget https://sourceforge.net/projects/dolibarr/files/latest/download
$ tar xvf dolibarr-8.03.tar.gz
$ sudo mv dolibarr-8.03.tar.gz dolibarr
$ sudo chown -R www-data:www-data www
$ sudo chmod -R 775 www
$ sudo chmod -R 755 www/dolibarr
-- Create a conf file for Database
$ sudo mkdir -p db/conf.d
$ sudo mkdir db/db_data
-- create and configure the Nginx configuration files with following entries
$ sudo mkdir -p nginx/conf.d
$ cd nginx/conf.d
$ sudo vim doli.conf
#make the following entries
server {
server_name localhost;
index index.html index.php;
root /var/www/html/dolibarr;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_read_timeout 3000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
:wq!
$ cd ..
$ sudo mkdir default.d
$ sudo vim nginx.conf
#put following lines
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
# Basic Settings
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Logging Settings
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# Gzip Settings
gzip on;
gzip_disable "msie6";
# Virtual Host Configs
include /etc/nginx/conf.d/*.conf;
}
:wq!
-- Now for PHP-fpm configuration file:
$ cd ..
$ sudo vim php-fpm.conf
;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ;
;;;;;;;;;;;;;;;;;;;;
include=etc/php-fpm.d/*.conf
:wq!
-- Now create the
$ cd ..
$ sudo mkdir .env
$ cd .env/
$ sudo vim db.env
MYSQL_DATABASE=dolibarr
MYSQL_USER=dolibarr
MYSQL_PASSWORD=dolibarr
MYSQL_ROOT_PASSWORD=dolibarr
:wq!
$ cd ..
$ ls -a
output:
. .. db docker-compose.yml .env nginx php-fpm.conf www
-- Now build the docker compose file:
$ sudo docker-compose up -d
$ sudo docker ps
-- open browser
http://localhost/install
Note: If during the installation if it would ask for any further
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Shashank Raj
He is very enthusiastic to learn and adapt to new technologies. Shows zeal in completing tasks. Redhat and AWS Certified. Linux, Docker, ELK, Kubernetes, Ansible, Terraform, AWS, Bash Scripting, Cloud automation, and Automation.