Updated docker related files

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2022-12-06 13:11:49 +01:00
parent c860ca6799
commit 4923b6d3a4
4 changed files with 19 additions and 18 deletions

View File

@ -1,34 +1,35 @@
FROM ubuntu:20.04 FROM ubuntu:22.04
ARG PACKAGE ARG PACKAGE
LABEL description="piler ubuntu focal image" \ LABEL description="piler ubuntu jammy image" \
maintainer="Janos SUTO, sj@acts.hu" \ maintainer="Janos SUTO, sj@acts.hu" \
package="${PACKAGE}" package="${PACKAGE}"
ENV DEBIAN_FRONTEND="noninteractive" \ ENV DEBIAN_FRONTEND="noninteractive" \
DISTRO="focal" \ DISTRO="jammy" \
DOWNLOAD_URL="https://download.mailpiler.com" \
PILER_USER="piler" \ PILER_USER="piler" \
MYSQL_DATABASE="piler" \ MYSQL_DATABASE="piler"
SPHINX_BIN_TARGZ="sphinx-3.3.1-bin.tar.gz"
COPY ${PACKAGE} / COPY ${PACKAGE} /
RUN apt-get update && \ RUN apt-get update && \
apt-get -y --no-install-recommends install \ apt-get -y --no-install-recommends install \
wget rsyslog openssl sysstat php7.4-cli php7.4-cgi php7.4-mysql php7.4-fpm php7.4-zip php7.4-ldap \ wget rsyslog openssl sysstat php8.1-cli php8.1-cgi php8.1-mysql php8.1-fpm php8.1-zip php8.1-ldap \
php7.4-gd php7.4-curl php7.4-xml php7.4-memcached catdoc unrtf poppler-utils nginx tnef sudo libzip5 \ php8.1-gd php8.1-curl php8.1-xml php8.1-memcached catdoc unrtf poppler-utils nginx tnef sudo libzip4 \
libtre5 cron libmariadb-dev mariadb-client-core-10.3 python3 python3-mysqldb ca-certificates curl && \ libtre5 cron libmariadb-dev mariadb-client-core-10.6 mariadb-server-10.6 python3 python3-mysqldb ca-certificates curl && \
wget https://repo.manticoresearch.com/manticore-repo.noarch.deb && \
dpkg -i manticore-repo.noarch.deb && \
rm -f manticore-repo.noarch.deb && \
apt-get update && \
apt-get install -y manticore manticore-columnar-lib && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* && \ rm -rf /var/lib/apt/lists/* && \
wget --no-check-certificate -q -O ${SPHINX_BIN_TARGZ} ${DOWNLOAD_URL}/generic-local/${SPHINX_BIN_TARGZ} && \
tar zxvf ${SPHINX_BIN_TARGZ} && \
sed -i 's/mail.[iwe].*//' /etc/rsyslog.conf && \ sed -i 's/mail.[iwe].*//' /etc/rsyslog.conf && \
sed -i '/session required pam_loginuid.so/c\#session required pam_loginuid.so' /etc/pam.d/cron && \ sed -i '/session required pam_loginuid.so/c\#session required pam_loginuid.so' /etc/pam.d/cron && \
dpkg -i ${PACKAGE} && \ dpkg -i ${PACKAGE} && \
ln -sf /etc/piler/piler-nginx.conf /etc/nginx/sites-enabled && \ ln -sf /etc/piler/piler-nginx.conf /etc/nginx/sites-enabled && \
rm -f ${PACKAGE} ${SPHINX_BIN_TARGZ} /etc/nginx/sites-enabled/default /etc/piler/piler.key /etc/piler/piler.pem /etc/piler/config-site.php && \ rm -f ${PACKAGE} /etc/nginx/sites-enabled/default /etc/piler/piler.key /etc/piler/piler.pem /etc/piler/config-site.php && \
crontab -u $PILER_USER /usr/share/piler/piler.cron crontab -u $PILER_USER /usr/share/piler/piler.cron
VOLUME ["/etc/piler"] VOLUME ["/etc/piler"]

View File

@ -12,5 +12,5 @@ Pick the latest deb package from Bitbucket download page (https://bitbucket.org/
and use it as the PACKAGE build argument, eg. and use it as the PACKAGE build argument, eg.
``` ```
docker build --build-arg PACKAGE=piler_1.3.11-focal-5c2ceb1_amd64.deb -t piler:1.3.11 . docker build --build-arg PACKAGE=piler_1.4.1-jammy-c860ca67_amd64.deb -t piler:1.4.1 .
``` ```

View File

@ -33,7 +33,7 @@ services:
command: -m 64 command: -m 64
piler: piler:
image: sutoj/piler:1.3.10 image: sutoj/piler:1.4.1
init: true init: true
environment: environment:
- MYSQL_DATABASE=piler - MYSQL_DATABASE=piler

View File

@ -10,7 +10,7 @@ PILER_CONF="${CONFIG_DIR}/piler.conf"
PILER_KEY="${CONFIG_DIR}/piler.key" PILER_KEY="${CONFIG_DIR}/piler.key"
PILER_PEM="${CONFIG_DIR}/piler.pem" PILER_PEM="${CONFIG_DIR}/piler.pem"
PILER_NGINX_CONF="${CONFIG_DIR}/piler-nginx.conf" PILER_NGINX_CONF="${CONFIG_DIR}/piler-nginx.conf"
SPHINX_CONF="${CONFIG_DIR}/sphinx.conf" SPHINX_CONF="${CONFIG_DIR}/manticore.conf"
CONFIG_SITE_PHP="${CONFIG_DIR}/config-site.php" CONFIG_SITE_PHP="${CONFIG_DIR}/config-site.php"
PILER_MY_CNF="${CONFIG_DIR}/.my.cnf" PILER_MY_CNF="${CONFIG_DIR}/.my.cnf"
@ -172,13 +172,13 @@ create_my_cnf_files() {
start_services() { start_services() {
service rsyslog start service rsyslog start
service cron start service cron start
service php7.4-fpm start service php8.1-fpm start
service nginx start service nginx start
} }
start_piler() { start_piler() {
if [[ ! -f "${VOLUME_DIR}/sphinx/main1.spp" ]]; then if [[ ! -f "${VOLUME_DIR}/manticore/main1.spp" ]]; then
log "main1.spp does not exist, creating index files" log "main1.spp does not exist, creating index files"
su -c "indexer --all --config ${SPHINX_CONF}" piler su -c "indexer --all --config ${SPHINX_CONF}" piler
fi fi
@ -198,4 +198,4 @@ init_database
start_services start_services
start_piler start_piler
while true; do sleep 3600; done sleep infinity