This is dockerized version of Live Helper Chat. It includes these images
web
- nginx servicephp
- php-fpm servicecobrowse
- cobrowsing running NodeJS servicephp-cronjob
- cronjobs running servicephp-resque
- php-resque worker running servicenodejshelper
- NodeJS Helper NodeJS running serviceredis
- Redis servicedb
- Database service
-
Checkout the repository
-
Run
cd docker-standalone
-
Copy
.env.default
to.env
-
Edit
.env
file and changeLHC_SECRET_HASH
to any random string -
Database default settings if you don't change those in
.env
file.- Host -
db
- Database name -
lhc
- Database username -
lhc
- Database password -
lhc
- Host -
-
For version with NodeJS plugin (Recommended)
- Run
install-nodejs.sh
this will checkout Live Helper Chat and required extensions - Optional. Run
docker compose -f docker-compose-nodejs.yml build --no-cache
to build from scratch. You might need it you are running onlinux/arm64
as I only providelinux/amd64
architecture - Run
docker compose -f docker-compose-nodejs.yml pull && docker-compose -f docker-compose-nodejs.yml up
to use already existingimages
- Run
-
For standard version without NodeJS plugin run
- Run
install.sh
this will checkout Live Helper Chat and required extensions - Optional. Run
docker compose -f docker-compose-standard.yml build --no-cache
to build from scratch. Build is optional. You might need it you are running onlinux/arm64
as I only providelinux/amd64
architecture - Run
docker compose -f docker-compose-standard.yml pull && docker-compose -f docker-compose-standard.yml up
- Run
-
You will need to install composer dependencies
docker exec -it docker-standalone-php-1 /bin/bash
cd /code/
# Commands from https://getcomposer.org/download/
php composer.phar install
- Edit
docker-standalone/lhc-php-resque/lhcphpresque/settings/settings.ini.php
and put propersite_address
domain value. php-resque does not know what domain it's running - Navigate to localhost:8081 and follow install instructions.
- If you want to run docker as a service append
-d
to docker commands.docker-compose -f docker-compose-nodejs.yml up -d
At first install steps you might need to run these commands to change folders permissions.
docker exec -it docker-standalone-web-1 chown -R www-data:www-data /code/cache
docker exec -it docker-standalone-web-1 chown -R www-data:www-data /code/settings
docker exec -it docker-standalone-web-1 chown -R www-data:www-data /code/var
or change permission of these folders
livehelperchat/lhc_web/cache
livehelperchat/lhc_web/settings
livehelperchat/lhc_web/var
Edit .env
file and set LHC_PUBLIC_PORT
and LHC_NODE_JS_PORT
port to 80
That's up to you. You can have in host machine runing nginx and just proxy request or tweak images/docker files I provided. You should play around with web
service.
E.g to the ones who are too lazy too use google :D
Generate SSL certificate under docker folder for demo.livehelperchat.com
domain. Change paths in this command. You have to be pointed domain to your sever
certbot certonly --config-dir /opt/lhc/docker-standalone/conf/nginx/ssl --webroot --webroot-path /opt/lhc/docker-standalone/livehelperchat/lhc_web -d demo.livehelperchat.com
This is how cronjob can look like. Make sure you put your domain and correct docker-standalone-web-1
name.
0 0 * * * certbot certonly --keep-until-expiring --config-dir /opt/lhc/docker-standalone/conf/nginx/ssl --webroot --webroot-path /opt/lhc/docker-standalone/livehelperchat/lhc_web -d demo.livehelperchat.com --post-hook "docker restart docker-standalone-web-1" > /dev/null 2>&1
If you are migrating server and want to setup fresh certbot, you can just use this command
certbot certonly --manual --preferred-challenges http --config-dir /opt/lhc/docker-standalone/conf/nginx/ssl -d demo.livehelperchat.com
web
service part will have to look like
web:
image: nginx:latest
env_file: .env
ports:
- "${LHC_PUBLIC_PORT}:80"
- "443:443"
volumes:
- ./livehelperchat/lhc_web:/code
- ./conf/nginx/site-ssl.conf:/etc/nginx/conf.d/default.conf
- ./conf/nginx/mime.types:/etc/nginx/mime.types
- ./conf/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./conf/nginx/ssl/live/demo.livehelperchat.com/fullchain.pem:/etc/nginx/ssl/demo.livehelperchat.com/fullchain.pem
- ./conf/nginx/ssl/live/demo.livehelperchat.com/privkey.pem:/etc/nginx/ssl/demo.livehelperchat.com/privkey.pem
depends_on:
- db
- php
- php-cronjob
networks:
- code-network
restart: always
Modify /conf/nginx/site-ssl.conf
and change where you see demo.livehelperchat.com
to your domain.
Rebuild docker image after a changes.
cd /opt/lhc/docker-standalone && docker compose -f docker-compose-nodejs.yml build --no-cache
Remember to automated SSL issuing workflow :)
cd /opt/lhc/docker-standalone && docker compose -f docker-compose-nodejs.yml down
cd /opt/lhc/docker-standalone && docker compose -f docker-compose-nodejs.yml up -d
You have to edit back office mail settings and use SMTP.
# Update docker images
cd docker-standalone && git pull origin master
# If there is any changes you can build your containers
docker compose -f docker-compose-nodejs.yml build --no-cache
# Or just pull new ones
docker-compose -f docker-compose-nodejs.yml pull
# I would recommend also just restart composer containers
docker compose -f docker-compose-nodejs.yml down
docker compose -f docker-compose-nodejs.yml up
# OR start docker as service
docker compose -f docker-compose-nodejs.yml up -d
# All these commands are executed from docker-standalone folder
cd livehelperchat && git pull origin master
cd lhc-php-resque && git pull origin master
cd NodeJS-Helper && git pull origin master
# Login to php-fpm container and execute
docker exec -it docker-standalone-php-1 /bin/bash
# Execute in container
cd /code && php cron.php -s site_admin -c cron/util/update_database -p local
cd /code && php cron.php -s site_admin -c cron/util/clear_cache
- Go to
Settings -> Live help confgiuration -> Chat configuration -> Screen sharing
and- Check
NodeJs support enabled
- In
socket.io path, optional
enter/wsnodejs/socket.io
- Check
- Go to
Settings -> Live help confgiuration -> Chat configuration -> Online tracking
and- Check
Cleanup should be done only using cronjob.
- Check
Footprint updates should be processed in the background. Make sure you are running workflow background cronjob.
- Check
- Go to
Settings -> Live help confgiuration -> Chat configuration -> Misc
and- Check
Disable live auto assign
- Check
- Go to
Settings -> Live help confgiuration -> Chat configuration -> Workflow
and- Check
Should cronjob run departments transfer workflow, even if user leaves a chat
- Check
- Set
'site_address' => 'https://chat.example.com'
insettings/settings.ini.php
to your install installation path. It has to be location whereindex.php
is located. - Set
site_address
indocker-standalone/lhc-php-resque/lhcphpresque/settings/settings.ini.php
- After install make sure
settings/settings.ini.php
file looks like this if you are usingphp-resque
andnodejs
-
array ( 0 => 'lhcphpresque', 1 => 'nodejshelper', ),```