Sessions using redis

I migrated InvoicePlane 1.5.9 to dockers and load balanced them across apache mesos. The issue I run into is the Sessions. in PHP, sessions is already using Redis, yet it looks like in the config.php, there is an option for sessions and default is ‘files’ How can this be changed to use redis?

Thank you!

Alex

I don’t think codeigniter and version 1 ars ready for redis.
If there’s a way to make codeigniter use redis, then that’s what needs to happen to the config file.
We need a docker setup for version2, can you help with that?

1 Like

@UnderDog- Thank you for the reply regarding Redis.

As for the Docker, I have not tested V2.x yet since I’m still working off of 1.5.9 as a test for docker builds. At present, I am using a static build of the application and rolling it into a container with an NGINX frontend. I needed to do this to stay away from a single point of failure with a mono build or even having a backup server… Dockers (to me) handle this very nicely and scales linear. Once we get a session handle functional, I can test with the 2.x branch.

A

1 Like

anything will help regarding docker, so If you have something for 1.5.9, I’ll build 2.0 on it, no problem. I’ll even include redis in 2.0 to make everything complete

@UnderDog

The ‘Docker’ is a simple Dockerfile for static builds. Since I use Gitlab Ci/CD, I push any code into Gitlab and then Gitlab runners will build the docker and push it out for production. However, in this scenario, I can only have one docker run since the session is not extracted away from the file system, but nonetheless, here is the Dockerfile that builds the docker for each CI/CD process, and this one is using Apache2:

##############################################################################

FROM ubuntu:18.04

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y apt-utils apache2 php7.2 php7.2-mysqli php7.2-fpm
libapache2-mod-php7.2
php-redis
php7.2-gd
php7.2-json
php7.2-mbstring
php7.2-recode
php7.2-xmlrpc \

ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_PID_FILE /var/run/apache2.pid
ENV APACHE_RUN_DIR /var/run/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2

COPY 000-default.conf /etc/apache2/sites-enabled/000-default.conf
COPY php.ini /etc/php/7.2/apache2
COPY php.ini /etc/php/7.2/fpm
COPY apache2.conf /etc/apache2/apache2.conf
COPY www/ /var/www/html

RUN rm /var/www/html/index.html && chmod -R 777 /var/www && a2enmod php7.2

CMD /usr/sbin/apachectl -D FOREGROUND

EXPOSE 80

2 Likes

Great contribution @UnderDog.