Hi everybody!
Thank you all for your precious work!
I guess it will be very useful to publish a Dockerfile (benchmark dockerfile) for testing purpose Suitecrm.
Too much time we spend to trace versions … when we have some problem.
I have one, but I am a pretty young suitecrm user/admin.
Is there a way to have a “benchmark” dockerfile?
pgr
3 January 2023 10:24
2
Have a look at this (abandoned) work in progress
salesagility:develop
← mcarpenterjr:docker-containers
opened 09:04PM - 20 Jun 19 UTC
## Description
Add support for Docker containers, this PR does/will con… tain a Dockerfile and matching docker-compose.yml for use in the creation and deployment of a Suite CRM container.
It desires to be ambiguous so it can be used from the CLI to create an image or deploy a container as well as support the needs of automated deployment through a CI if needed.
At the lowest level simply running `docker build ./docker/` from the root of Suite should yield a fresh image built from the "master" branch of the official repository.
At the highest (That I've thought of so far) using docker-compose, a user should be able to pass a target repository, branch and specify if the container should use an internal database or a separate container for the database.
No matter the level of abstraction Suite should install and set itself up, so when a container is started Suite is ready to rock.
## Motivation and Context
This breaks the dependence on third parties for the supply of containers, also will help with quick deployment of an instance.
In the running instance I am working from, gitlab i used to track any changes, but has to rsync anything done through the CI to the container that is host to suite. The container is an image from the third party bitnami (I have nothing against Bitnami, just the fact that I'm at their mercy when it comes to Suite) I've focused on the gitlab-ci to get started but this should work with any scriptable continuous integration out there. Or right from the command line.
## How To Test This
You should have both docker and docker-compose installed.
Running `docker-compose -f ./docker/docker-compose.yml up -d --force-recreate --always-recreate-deps` from the branches root will create a mariadb container and then build and deploy the docker container.
Running `docker build --force-rm -t smt/suitecrm:latest ./docker/` Will build an image that can then be used to deploy a container.
## Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
### Final checklist
- [ ] My code follows the code style of this project found [here](https://docs.suitecrm.com/community/contributing-code/coding-standards/).
- [X] My change requires a change to the documentation.
- [X] I have read the [**How to Contribute**](https://docs.suitecrm.com/community/contributing-code/) guidelines.
In summary, at this point, the concept works, if docker is available the containers get created but the silent install part fails, and the DB conficuration is incomplete.
VMWare works fine in Bitnami rep has a dockerized suitecrm 8.2.1. Good Work!
I only guess for testing pupose the standard LAMP docker env, not the dockerized suiteCRM (I think Bitnami is enough).
BITNAMI dockerized SuiteCRM
Thank you!
Hi Everybody!
After many testing tentatives… I share this PHP dockerfile (7.4) seems minimize error.
I have tested it with 8.2.1 (more stable and fixed than recent 8.2.2 - some bug email account managment):
This is the best medicine for your headache:
FROM php:7.4.33-apache-buster
# Surpresses debconf complaints of trying to install apt packages interactively
# https://github.com/moby/moby/issues/4032#issuecomment-192327844
ARG DEBIAN_FRONTEND=noninteractive
# Update
RUN apt-get -y update --fix-missing && \
apt-get upgrade -y && \
apt-get --no-install-recommends install -y apt-utils && \
rm -rf /var/lib/apt/lists/*
# Install useful tools and install important libaries
RUN apt-get -y update && \
apt-get -y --no-install-recommends install nano wget \
dialog \
libsqlite3-dev \
libsqlite3-0 && \
apt-get -y --no-install-recommends install default-mysql-client \
zlib1g-dev \
libzip-dev \
libicu-dev && \
apt-get -y --no-install-recommends install --fix-missing apt-utils \
build-essential \
git \
curl \
libonig-dev && \
apt-get install -y iputils-ping && \
apt-get -y --no-install-recommends install --fix-missing libcurl4 \
libcurl4-openssl-dev \
zip \
openssl && \
rm -rf /var/lib/apt/lists/* && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install xdebug
RUN pecl install xdebug-3.1.4 && \
docker-php-ext-enable xdebug && \
mkdir /var/log/xdebug
# Install redis
RUN pecl install redis-5.1.1 && \
docker-php-ext-enable redis
# Install imagick
RUN apt-get update && \
apt-get -y --no-install-recommends install --fix-missing libmagickwand-dev && \
rm -rf /var/lib/apt/lists/* && \
pecl install imagick && \
docker-php-ext-enable imagick
# Other PHP7 Extensions
RUN docker-php-ext-install pdo_mysql && \
docker-php-ext-install pdo_sqlite && \
docker-php-ext-install bcmath && \
docker-php-ext-install mysqli && \
docker-php-ext-install curl && \
docker-php-ext-install tokenizer && \
docker-php-ext-install json && \
docker-php-ext-install zip && \
docker-php-ext-install -j$(nproc) intl && \
docker-php-ext-install mbstring && \
docker-php-ext-install gettext && \
docker-php-ext-install calendar && \
docker-php-ext-install opcache && \
docker-php-ext-install exif
RUN apt-get -y update && \
apt-get install -y libxml++2.6-dev && \
docker-php-ext-install soap
RUN apt-get update && apt-get install -y libc-client-dev libkrb5-dev && \
rm -r /var/lib/apt/lists/* && \
PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install -j$(nproc) imap
# Install Freetype
RUN apt-get -y update && \
apt-get --no-install-recommends install -y libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev && \
rm -rf /var/lib/apt/lists/* && \
docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg && \
docker-php-ext-install gd
# Insure an SSL directory exists
RUN mkdir -p /etc/apache2/ssl
# Enable SSL support
RUN a2enmod ssl && a2enmod rewrite
# Enable apache modules
RUN a2enmod rewrite headers
# Cleanup
RUN rm -rf /usr/src/*
If you have some improvement share please and reply.
Also php:8.0.26-apache-buster works fine (even if some problem in email imap managment )
pgr
4 January 2023 13:31
5
You will probably want to add a few tweaks to php.ini files.
I use default settings for modules charged;
In Php.ini I set:
memory_limit = 512M
post_max_size = 100M
upload_max_filesize = 100M
display_errors = off
session.auto_start = 0
Do you have any suggest?
html_errors = off
error_reporting = E_ALL & ~E_DEPRECATED
pgr
4 January 2023 15:25
7
I don’t know much about Docker, I’ve only used it lightly, with images built by others.
Isn’t the SuiteCRM installation supposed to go into that build script? And the php.ini changes?