Docker vs non-Docker installation requirements
Collapse
X
-
thanks for sharing your experience,but you have 9GB of RAM on server, and this an overkill for us. We are also a small company with about 5-10 active users, and we plan to keep it low, at 2Gb RAM.
Leave a comment:
-
thought you'd also like some graphena stats, we are a 200 people company with about 15 active users
👍 1Leave a comment:
-
Now you’re talking. I love my Docker install. It took a while to get it set up nicely, but it’s working wonderfully. Depending on your data complexity, it should work well for you. I find it’s more about data complexity, as currently there is no Espo way to specify the keys.
Here is my Docker setup if it helps you. Note it uses .env to give me local, demo, and prod setups. Sorry for the lack of formatting—I don’t know how to do it in this forum.
services:
db:
image: mariadb:latest
container_name: ${CONTAINER_NAME}-db
restart: unless-stopped
environment:
TZ: Europe/London
MARIADB_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MARIADB_USER: ${DB_USER}
MARIADB_PASSWORD: ${DB_PASSWORD}
MARIADB_DATABASE: ${DB_DATABASE}
volumes:
- db-data:/var/lib/mysql
- mysql-logs:/var/log/mysql
- ./docker/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
- ./docker/mysql.cnf:/etc/mysql/conf.d/my_custom.cnf:ro
#- ./my-debug.cnf:/etc/mysql/conf.d/my.cnf
healthcheck:
test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ]
interval: 20s
start_period: 10s
timeout: 10s
retries: 3
ports:
- "${DB_PORT:-3307}:3306"
expose:
- "${DB_PORT:-3307}"
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
networks:
- espocrm-net
app:
build: .
image: ${CONTAINER_NAME}:latest
command: apache2-foreground
container_name: ${CONTAINER_NAME}-app
restart: unless-stopped
environment:
TZ: Europe/London
PHP_MEMORY_LIMIT: 512M
PHP_DISPLAY_ERRORS: ${PHP_DISPLAY_ERRORS}
PHP_DISPLAY_STARTUP_ERRORS: ${PHP_DISPLAY_STARTUP_ERRORS}
PHP_ERROR_REPORTING: ${PHP_ERROR_REPORTING}
ESPOCRM_DATABASE_PLATFORM: Mysql
ESPOCRM_DATABASE_HOST: ${CONTAINER_NAME}-db
ESPOCRM_DATABASE_USER: ${DB_USER}
ESPOCRM_DATABASE_PASSWORD: ${DB_PASSWORD}
ESPOCRM_ADMIN_USERNAME: ${ESPOCRM_ADMIN_USERNAME}
ESPOCRM_ADMIN_PASSWORD: ${ESPOCRM_ADMIN_PASSWORD}
ESPOCRM_SITE_URL: ${ESPOCRM_SITE_URL}
APACHE_SERVER_NAME: ${SERVER_NAME}
volumes:
- ./:/var/www/html
- upload:/var/www/html/data/upload
- ./docker/php.ini:/usr/local/etc/php/conf.d/zzz-custom.ini
# - ./docker/php-dev.ini:/usr/local/etc/php/conf.d/zzz-custom.ini
# - ./docker/localhost.crt:/etc/ssl/certs/localhost.crt
# - ./docker/localhost.key:/etc/ssl/private/localhost.key
depends_on:
db:
condition: service_healthy
ports:
- "${WEB_PORT:-80}:80"
healthcheck:
test: ["CMD-SHELL", "curl -kfsS ${SITE_URL}:${WEB_PORT} || exit 1"]
interval: 30s
timeout: 10s
retries: 3
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
networks:
- espocrm-net
websocket:
image: ${CONTAINER_NAME}:latest
container_name: ${CONTAINER_NAME}-websocket
command: php websocket.php
restart: unless-stopped
environment:
TZ: Europe/London
ESPOCRM_DATABASE_PLATFORM: Mysql
ESPOCRM_DATABASE_HOST: ${CONTAINER_NAME}-db
ESPOCRM_DATABASE_USER: ${DB_USER}
ESPOCRM_DATABASE_PASSWORD: ${DB_PASSWORD}
ESPOCRM_CONFIG_USE_WEB_SOCKET: "true"
ESPOCRM_CONFIG_WEB_SOCKET_PORT: "8080"
ESPOCRM_CONFIG_WEB_SOCKET_DEBUG_MODE: "false"
ESPOCRM_CONFIG_PHP_EXECUTABLE_PATH: "/usr/local/bin/php"
ports:
- "${WEBSOCKET_PORT}:8080"
volumes:
- ./:/var/www/html
depends_on:
- db
healthcheck:
test: ["CMD", "php", "-r", "echo (fsockopen('127.0.0.1', 8080) ? 'OK' : 'FAIL');"]
interval: 30s
timeout: 5s
retries: 3
networks:
- espocrm-net
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
daemon:
image: ${CONTAINER_NAME}:latest
container_name: ${CONTAINER_NAME}-daemon
command: php daemon.php
restart: unless-stopped
environment:
TZ: Europe/London
ESPOCRM_DATABASE_PLATFORM: Mysql
ESPOCRM_DATABASE_HOST: ${CONTAINER_NAME}-db
ESPOCRM_DATABASE_USER: ${DB_USER}
ESPOCRM_DATABASE_PASSWORD: ${DB_PASSWORD}
# Daemon configuration
ESPOCRM_CONFIG_DAEMON_MAX_PROCESS_NUMBER: "5"
ESPOCRM_CONFIG_DAEMON_INTERVAL: "10"
ESPOCRM_CONFIG_DAEMON_PROCESS_TIMEOUT: "36000"
ESPOCRM_CONFIG_PHP_EXECUTABLE_PATH: "/usr/local/bin/php"
volumes:
- ./:/var/www/html
- upload:/var/www/html/data/upload
depends_on:
db:
condition: service_healthy
networks:
- espocrm-net
healthcheck:
test: ["CMD-SHELL", "pgrep -f 'php daemon.php' >/dev/null || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
volumes:
db-data:
mysql-logs:
upload:
driver: local
driver_opts:
type: nfs
o: addr=192.9.201.130,nfsvers=4
device: ":/volume2/espofiles/upload"
networks:
espocrm-net:
driver: bridge
and the docker file
FROM php:8.4-apache
# Copy Composer from the official Composer image
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libzip-dev \
exif \
unzip \
git \
libzmq3-dev \
pkg-config \
netcat-openbsd \
cron \
fonts-dejavu-core \
fonts-dejavu-extra \
libmagickwand-dev
# PHP extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd zip exif pdo pdo_mysql pcntl posix
# Install Imagick
RUN pecl install imagick \
&& docker-php-ext-enable imagick
# ZMQ extension (with fallback manual build)
RUN pecl install zmq || ( \
git clone https://github.com/zeromq/php-zmq.git /tmp/php-zmq && \
cd /tmp/php-zmq && phpize && ./configure && make && make install \
) && docker-php-ext-enable zmq
# uncomment when in final production
# RUN apt-get clean && rm -rf /var/lib/apt/lists/*
RUN echo "* * * * * cd /var/www/html; /usr/local/bin/php -f cron.php > /dev/null 2>&1" | crontab -u www-data -
RUN a2enmod rewrite
WORKDIR /var/www/html
COPY . /var/www/html/
COPY docker/apache.cnf /etc/apache2/sites-available/espocrm.conf
RUN a2dissite 000-default.conf \
&& a2ensite espocrm.conf
COPY docker/apache-timeout.conf /etc/apache2/conf-available/timeout.conf
RUN a2enconf timeout.conf
RUN mkdir -p /var/www/html/data/cache/application/acl \
&& mkdir -p /var/www/html/data/cache/application/aclMap \
&& mkdir -p /var/www/html/data/logs
RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 755 /var/www/html
RUN echo "memory_limit = 1024M" > /usr/local/etc/php/conf.d/memory-limit.iniLeave a comment:
-
That's a difficult question to answer, as it depends on how you use your CRM system. A fresh installation of EspoCRM requires less than 8 GB.
However, if you plan to save emails, documents, and so on, your data usage will increase.
👍 1Leave a comment:
-
thank you so much for such a detailed answer. One more question: on the Nginx server config help page I don't see any particular space requirement Nginx - EspoCRM DocumentationHi AlexiLaiho,
First of all, it's important to note that hosting projects in a Docker environment is better for portability and isolation. These advantages put a greater strain on RAM and disc space, as Docker uses images and layers in conjunction with containers and networks.
For your needs, it's best to use a combination of Nginx (it's lighter than Apache), PHP-FPM, and MariaDB in LEMP stack; 1 GB of RAM is sufficient for this setup. However, keep in mind that it's advisable to at least slightly increase the available disc space, as it's usually used by backups and attachments from EspoCRM, and at some point the server may simply stop responding due to insufficient space.
What amount of space would be sufficient and future-proof for average Espo installation on LEMP stack?Leave a comment:
-
Hi AlexiLaiho,
First of all, it's important to note that hosting projects in a Docker environment is better for portability and isolation. These advantages put a greater strain on RAM and disc space, as Docker uses images and layers in conjunction with containers and networks.
For your needs, it's best to use a combination of Nginx (it's lighter than Apache), PHP-FPM, and MariaDB in LEMP stack; 1 GB of RAM is sufficient for this setup. However, keep in mind that it's advisable to at least slightly increase the available disc space, as it's usually used by backups and attachments from EspoCRM, and at some point the server may simply stop responding due to insufficient space.Leave a comment:
-
-
Speaking from the point of view of simplicity - the easiest option is installation by script (like yours): https://docs.espocrm.com/administrat...ion-by-script/. And if you do not plan to use anything other than EspoCRM on your VPS, then this is the easiest way.
Here, probably, other community members should also express their opinion. But, until you try Docker and non-Docker yourself, you will not be able to determine for yourself what is better and what is not.Leave a comment:
-
Docker vs non-Docker installation requirements
Hi,
I installed Espo via script in a Docker way, it is running fine, but now I'm considering moving onto a cheaper cloud. DO is getting pricier and pricier, so now I'm becoming more demanding to resources and their costs.
Thinking resourcefully and economically, what gives the most performant way to set up Espo: via docker or via traditional LAMP stack?
Now I'm running it in a 60GB droplet with 2vCPU and 2Gb RAM. Ideally, I would prefer to squeeze it into 15-20GB instance with 1-2GB RAM and cheapest CPU type.
I've read this page Configuration - EspoCRM Documentation, but I prefer to get comparative analysis between Docker and non-Docker.Tags: None

Leave a comment: