akaunting / docker

Docker Image for Akaunting
https://github.com/akaunting/akaunting
GNU General Public License v3.0
185 stars 86 forks source link

Can't get Redis cache work #54

Closed navjotjsingh closed 2 years ago

navjotjsingh commented 2 years ago

I am using Ubuntu 20.04 along with Docker 20.10.11

My run.env file

# You should change this to match your reverse proxy DNS name and protocol
APP_URL=https://akaunting.example.xyz
LOCALE=en-US

# Don't change this unless you rename your database container or use rootless podman, in case of using rootless podman you should set it to 127.0.0.1 (NOT localhost)
DB_HOST=akaunting-db

# Change these to match env/db.env
DB_DATABASE=akaunting
DB_USERNAME=akauntinguser
DB_PASSWORD=password

# You should change this to a random string of three numbers or letters followed by an underscore
DB_PREFIX=asd_

# These define the first company to exist on this instance. They are only used during setup.
COMPANY_NAME=Company
COMPANY_EMAIL=me@example.com

# This will be the first administrative user created on setup.
ADMIN_EMAIL=me@example.com
ADMIN_PASSWORD=password

# Cache Details
CACHE_DRIVER=redis
REDIS_CLIENT=phpredis
REDIS_CLUSTER=redis
REDIS_PASSWORD=8IqU6nlsFm5vDZJFZrXIcYvbN7jFGoAN2Fm5lwrD/XObkpIs+H+zhpUJBC28bRPGhVYlI37wguuMsoZl
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_CACHE_DB=1

I keep getting 502 errors on the site. Ran Docker logs on akaunting container. And I keep getting the error

In PhpRedisConnector.php line 77:

  Please make sure the PHP Redis extension is installed and enabled.

I even made changes to the Dockerfile to include installing php-redis.

FROM php:7.4-apache

ARG AKAUNTING_DOCKERFILE_VERSION=0.1
ARG SUPPORTED_LOCALES="en_US.UTF-8"

RUN apt-get update \
 && apt-get -y upgrade --no-install-recommends \
 && apt-get install -y \
    build-essential \
    imagemagick \
    libfreetype6-dev \
    libicu-dev \
    libjpeg62-turbo-dev \
    libjpeg-dev \
    libmcrypt-dev \
    libonig-dev \
    libpng-dev \
    libpq-dev \
    libssl-dev \
    libxml2-dev \
    libxrender1 \
    libzip-dev \
    locales \
    openssl \
    unzip \
    zip \
    zlib1g-dev \
    --no-install-recommends \
 && apt-get clean && rm -rf /var/lib/apt/lists/*

RUN for locale in ${SUPPORTED_LOCALES}; do \
    sed -i 's/^# '"${locale}/${locale}/" /etc/locale.gen; done \
 && locale-gen

RUN docker-php-ext-configure gd \
    --with-freetype \
    --with-jpeg \
 && docker-php-ext-install -j$(nproc) \
    gd \
    bcmath \
    intl \
    mbstring \
    pcntl \
    pdo \
    pdo_mysql \
    php-redis \
    zip

RUN mkdir -p /var/www/akaunting \
 && curl -Lo /tmp/akaunting.zip 'https://akaunting.com/download.php?version=latest&utm_source=docker&utm_campaign=developers' \
 && unzip /tmp/akaunting.zip -d /var/www/html \
 && rm -f /tmp/akaunting.zip

COPY files/akaunting.sh /usr/local/bin/akaunting.sh
COPY files/html /var/www/html

ENTRYPOINT ["/usr/local/bin/akaunting.sh"]
CMD ["--start"]

And I am still getting the same error message asking me to install PHP redis. How to make it work?

MohammedAl-Mahdawi commented 2 years ago

Hi,

This repo is for building the official Akaunting images so please only post issues related to the official Akaunting images or the default setup of the compose files.

If you have questions or issues with your specific setup you can post your question/issue in our support channels here or on StackOverflow.

Thank you for understanding!

nightred commented 2 years ago

Not to be rude but the software supports redis and using this option with your docker should be a supported activity. Telling a user to leave you alone because you do not want to properly support the software docker image only hurts the image of the software and discourages new users from adopting the software. This is a very hostile close of the ticket and very disrespectful.