Updated to alpine, updated to ZnunyLTS 6.0.48

This commit is contained in:
Deon George 2023-04-24 15:33:28 +10:00
parent a84c5a482d
commit a005bb4f4e
3 changed files with 80 additions and 21 deletions

View File

@ -1,23 +1,32 @@
# NAME graytech/otrs # NAME leenooks/otrs
# VERSION 6.0.28 # VERSION latest
# BUILD docker build -t="leenooks/otrs" .
# SETUP su otrs -s /bin/bash -c /opt/otrs/bin/otrs.RebuildConfig.pl
# START docker run ...
# ftp://ftp.otrs.org/pub/otrs/packages/FAQ-5.0.3.opm
# ftp://ftp.otrs.org/pub/otrs/packages/iPhoneHandle-4.0.2.opm
FROM registry.leenooks.net/leenooks/base:7 FROM alpine
RUN yum -y install https://harbottle.gitlab.io/epmel/7/x86_64/epmel-release.rpm \ # Change to http respositories, so they we can cache the install packages
&& yum clean all && rm -rf /var/tmp/* RUN if [ -n ${HTTP_PROXY} ] ; then sed -ie s'/https/http/' /etc/apk/repositories; fi
RUN yum -y install \ RUN apk add shadow && groupadd -g 48 apache && useradd -d /opt/otrs -g apache -c 'OTRS user' otrs
"perl(Text::CSV_XS)" "perl(YAML::XS)" "perl(Crypt::Eksblowfish::Bcrypt)" "perl(Encode::HanExtra)" "perl(JSON::XS)" "perl(Moo)" "perl(namespace::clean)"\
"perl(Crypt::Random::Source)" "perl(Exporter::Tiny)" "perl(Math::Random::ISAAC)" "perl(Math::Random::Secure)" "perl(Module::Find)" "perl(Types::TypeTiny)" \
nginx perl-DBD-MySQL fcgiwrap \
http://ftp.otrs.org/pub/otrs/RPMS/rhel/7/otrs-6.0.28-01.noarch.rpm \
&& yum clean all && rm -rf /var/tmp/*
RUN apk add --no-cache nginx curl
RUN usermod nginx -G apache
RUN apk add --no-cache perl perl-fcgi fcgiwrap
RUN apk add --no-cache perl-dbi perl-dbd-mysql perl-dbd-pg
RUN apk add --no-cache perl-archive-zip perl-crypt-eksblowfish perl-css-minifier-xs perl-date-format \
perl-datetime perl-encode-hanextra perl-io-socket-ssl perl-javascript-minifier-xs perl-json-xs \
perl-mail-imapclient perl-authen-sasl perl-authen-ntlm perl-moo perl-net-dns perl-ldap perl-package-stash-xs \
perl-template-toolkit perl-text-csv_xs perl-yaml-xs perl-xml-libxml perl-xml-libxslt perl-xml-parser
#RUN apk add apache2-mod-perl --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/
RUN cd /tmp/ && wget https://download.znuny.org/releases/znuny-6.0.48.tar.gz \
&& tar -C /opt -xzf /tmp/znuny-6.0.48.tar.gz && ln -s ./znuny-6.0.48 /opt/otrs \
&& rm /tmp/znuny-6.0.48.tar.gz \
&& mkdir /opt/otrs/Kernel/Files \
&& /opt/otrs/bin/otrs.CheckModules.pl \
&& /opt/otrs/bin/otrs.SetPermissions.pl
COPY otrs.conf /etc/nginx/http.d/default.conf
COPY init /sbin COPY init /sbin
CMD [ "/sbin/init" ] CMD [ "/sbin/init" ]

12
init
View File

@ -3,16 +3,18 @@
OTRS_SOCK_DIR=/var/run/otrs OTRS_SOCK_DIR=/var/run/otrs
NGINX_USER=nginx NGINX_USER=nginx
# Add nging to apache group, since otrs is group owned to apache
usermod nginx -G apache
# Make our CGI socker # Make our CGI socker
mkdir ${OTRS_SOCK_DIR} mkdir ${OTRS_SOCK_DIR}
chown ${NGINX_USER} ${OTRS_SOCK_DIR} chown ${NGINX_USER} ${OTRS_SOCK_DIR}
su ${NGINX_USER} -s /bin/bash -c "/usr/sbin/fcgiwrap -fs unix:${OTRS_SOCK_DIR}/otrs.cgi.sock" & su ${NGINX_USER} -s /bin/sh -c "/usr/bin/fcgiwrap -fs unix:${OTRS_SOCK_DIR}/otrs.cgi.sock" &
ln -s /otrs/Config.pm /opt/otrs/Kernel/Config.pm
ln -s /otrs/Files/ZZZAAuto.pm /opt/otrs/Kernel/Files/
ln -s /otrs/Files/ZZZACL.pm /opt/otrs/Kernel/Files/
ln -s /otrs/Files/ZZZProcessManagement.pm /opt/otrs/Kernel/Files/
# Install OTRS Modules # Install OTRS Modules
su otrs -lc "bin/otrs.Console.pl Maint::Config::Rebuild; sleep 15; bin/otrs.Console.pl Admin::Package::ReinstallAll" su otrs -lc "bin/otrs.Console.pl Maint::Config::Rebuild; bin/otrs.Console.pl Admin::Package::ReinstallAll"
# Start cron and the OTRS Daemon # Start cron and the OTRS Daemon
/usr/sbin/crond /usr/sbin/crond

48
otrs.conf Normal file
View File

@ -0,0 +1,48 @@
server {
listen 80;
listen [::]:80;
# access_log /var/log/nginx/access.log;
client_max_body_size 10m;
# error_log /var/log/nginx/error.log;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 16k;
index index.html;
root /opt/otrs/var/httpd/htdocs;
server_tokens off;
location / {
return 301 /otrs/customer.pl;
}
location /admin {
return 301 /otrs/index.pl;
}
location /otrs-web {
gzip on;
alias /opt/otrs/var/httpd/htdocs;
}
location ~ ^/otrs/(.*\.pl)(/.*)?$ {
fastcgi_pass unix:/var/run/otrs/otrs.cgi.sock;
fastcgi_index index.pl;
fastcgi_param SCRIPT_FILENAME /opt/otrs/bin/fcgi-bin/$1;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
}
}