Compare commits
10 commits
c16804a913
...
cf874c41da
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf874c41da | ||
|
|
b3c3594a50 | ||
|
|
7e598d94bd | ||
|
|
244f06b264 | ||
|
|
8adbdfd447 | ||
|
|
4529180965 | ||
|
|
30b8655b31 | ||
|
|
8b2d3a6823 | ||
|
|
b388164147 | ||
|
|
ba293fbf69 |
22
Dockerfile
22
Dockerfile
|
|
@ -1,9 +1,9 @@
|
|||
FROM debian:bullseye
|
||||
FROM debian:bookworm
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ARG S6_OVERLAY_VERSION=3.1.3.0
|
||||
ARG S6_OVERLAY_ARCH="x86_64"
|
||||
ARG KOHA_VERSION=22.11
|
||||
ARG S6_OVERLAY_VERSION=3.2.0.2
|
||||
ARG KOHA_VERSION=24.11
|
||||
ARG TARGETARCH
|
||||
|
||||
LABEL org.opencontainers.image.source=https://github.com/teorgamm/koha-docker
|
||||
|
||||
|
|
@ -19,10 +19,16 @@ RUN apt-get update \
|
|||
|
||||
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
|
||||
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
|
||||
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz /tmp
|
||||
RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
|
||||
|
||||
RUN mkdir /etc/apt/keyrings/ && \
|
||||
RUN echo ${TARGETARCH} && case ${TARGETARCH} in \
|
||||
"amd64") S6_ARCH=x86_64 ;; \
|
||||
"arm64") S6_ARCH=aarch64 ;; \
|
||||
"arm") S6_ARCH=armhf ;; \
|
||||
esac \
|
||||
&& wget -P /tmp/ -q https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.xz \
|
||||
&& tar -C / -Jxpf /tmp/s6-overlay-${S6_ARCH}.tar.xz
|
||||
|
||||
RUN mkdir -p /etc/apt/keyrings/ && \
|
||||
wget -qO - https://debian.koha-community.org/koha/gpg.asc | gpg --dearmor -o /etc/apt/keyrings/koha.gpg && \
|
||||
echo "deb [signed-by=/etc/apt/keyrings/koha.gpg] https://debian.koha-community.org/koha ${KOHA_VERSION} main bullseye" | tee /etc/apt/sources.list.d/koha.list
|
||||
|
||||
|
|
@ -45,7 +51,7 @@ RUN a2enmod rewrite \
|
|||
&& mkdir -p /var/log/koha/apache \
|
||||
&& chown -R www-data:www-data /var/log/koha/apache
|
||||
|
||||
COPY --chown 0:0 files/ /
|
||||
COPY --chown=0:0 files/ /
|
||||
WORKDIR /docker
|
||||
|
||||
EXPOSE 2100 6001 8080 8081
|
||||
|
|
|
|||
|
|
@ -1,53 +0,0 @@
|
|||
FROM debian:bullseye
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ARG S6_OVERLAY_VERSION=3.1.3.0
|
||||
ARG S6_OVERLAY_ARCH="aarch64"
|
||||
ARG KOHA_VERSION=22.11
|
||||
|
||||
LABEL org.opencontainers.image.source=https://github.com/teorgamm/koha-docker
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y \
|
||||
wget \
|
||||
apache2 \
|
||||
gnupg2 \
|
||||
apt-transport-https \
|
||||
xz-utils \
|
||||
&& rm -rf /var/cache/apt/archives/* \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
|
||||
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
|
||||
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz /tmp
|
||||
RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
|
||||
|
||||
RUN mkdir /etc/apt/keyrings/ && \
|
||||
wget -qO - https://debian.koha-community.org/koha/gpg.asc | gpg --dearmor -o /etc/apt/keyrings/koha.gpg && \
|
||||
echo "deb [signed-by=/etc/apt/keyrings/koha.gpg] https://debian.koha-community.org/koha ${KOHA_VERSION} main bullseye" | tee /etc/apt/sources.list.d/koha.list
|
||||
|
||||
# Install Koha
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y koha-core \
|
||||
idzebra-2.0 \
|
||||
apache2 libapache2-mpm-itk\
|
||||
logrotate \
|
||||
&& rm -rf /var/cache/apt/archives/* \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN a2enmod rewrite \
|
||||
&& a2enmod headers \
|
||||
&& a2enmod proxy_http \
|
||||
&& a2enmod cgi \
|
||||
&& a2dissite 000-default \
|
||||
&& echo "Listen 8081\nListen 8080" > /etc/apache2/ports.conf \
|
||||
&& sed -E -i "s#^(export APACHE_LOG_DIR=).*#\1/var/log/koha/apache#g" /etc/apache2/envvars \
|
||||
&& mkdir -p /var/log/koha/apache \
|
||||
&& chown -R www-data:www-data /var/log/koha/apache
|
||||
|
||||
COPY --chown 0:0 files/ /
|
||||
WORKDIR /docker
|
||||
|
||||
EXPOSE 2100 6001 8080 8081
|
||||
|
||||
CMD [ "/init" ]
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
FROM debian:bullseye
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ARG S6_OVERLAY_VERSION=3.1.3.0
|
||||
ARG S6_OVERLAY_ARCH="armhf"
|
||||
ARG KOHA_VERSION=22.11
|
||||
|
||||
LABEL org.opencontainers.image.source=https://github.com/teorgamm/koha-docker
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y \
|
||||
wget \
|
||||
apache2 \
|
||||
gnupg2 \
|
||||
apt-transport-https \
|
||||
xz-utils \
|
||||
&& rm -rf /var/cache/apt/archives/* \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
|
||||
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
|
||||
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.xz /tmp
|
||||
RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
|
||||
|
||||
RUN mkdir /etc/apt/keyrings/ && \
|
||||
wget -qO - https://debian.koha-community.org/koha/gpg.asc | gpg --dearmor -o /etc/apt/keyrings/koha.gpg && \
|
||||
echo "deb [signed-by=/etc/apt/keyrings/koha.gpg] https://debian.koha-community.org/koha ${KOHA_VERSION} main bullseye" | tee /etc/apt/sources.list.d/koha.list
|
||||
|
||||
# Install Koha
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y koha-core \
|
||||
idzebra-2.0 \
|
||||
apache2 libapache2-mpm-itk\
|
||||
logrotate \
|
||||
&& rm -rf /var/cache/apt/archives/* \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN a2enmod rewrite \
|
||||
&& a2enmod headers \
|
||||
&& a2enmod proxy_http \
|
||||
&& a2enmod cgi \
|
||||
&& a2dissite 000-default \
|
||||
&& echo "Listen 8081\nListen 8080" > /etc/apache2/ports.conf \
|
||||
&& sed -E -i "s#^(export APACHE_LOG_DIR=).*#\1/var/log/koha/apache#g" /etc/apache2/envvars \
|
||||
&& mkdir -p /var/log/koha/apache \
|
||||
&& chown -R www-data:www-data /var/log/koha/apache
|
||||
|
||||
COPY --chown 0:0 files/ /
|
||||
WORKDIR /docker
|
||||
|
||||
EXPOSE 2100 6001 8080 8081
|
||||
|
||||
CMD [ "/init" ]
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# koha-docker
|
||||
|
||||

|
||||

|
||||
|
||||
A Koha Docker container which includes:
|
||||
* The Apache webserver serving the OPAC (Port 8080) and
|
||||
|
|
@ -26,10 +26,15 @@ The image is available on [Docker Hub](https://hub.docker.com/r/teogramm/koha)
|
|||
The main configuration environment variables are documented in
|
||||
[config-main.env](config-main.env).
|
||||
|
||||
For a quick start check out the included [docker-compose](examples/docker-compose.yaml) file.
|
||||
The username and password for the initial setup are the same as the database username and password.
|
||||
|
||||
Logs for stored under the `/var/log/koha` directory.
|
||||
|
||||
In order to function, Koha requires a MySQL database, a Memcached server and a RabbitMQ server with the stomp plugin.
|
||||
|
||||
The provided [docker-compose file](examples/docker-compose.yaml) sets up all of these as containers. It provides an easy way to
|
||||
get a Koha insstance up and running. For a production environment it is recommened that each container is set up separately.
|
||||
|
||||
## Credits
|
||||
|
||||
Some scripts have been taken from https://gitlab.com/koha-community/docker/koha-docker and modified.
|
||||
|
|
|
|||
|
|
@ -20,10 +20,11 @@ KOHA_LANGS=
|
|||
ZEBRA_MARC_FORMAT=marc21
|
||||
|
||||
# Elasticsearch options
|
||||
# If the ELASTICSEARCH_HOST variable is set the
|
||||
# If the USE_ELASTICSEARCH variable is set the
|
||||
# container is set yp to use Elasticsearch. A
|
||||
# Zebra server is spawned inside the container,
|
||||
# otherwise.
|
||||
#USE_ELASTICSEARCH=true
|
||||
#ELASTICSEARCH_HOST=
|
||||
#OVERRIDE_SYSPREF_SearchEngine=Elasticsearch
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
version: "3.9"
|
||||
services:
|
||||
koha:
|
||||
image: teogramm/koha:22.11
|
||||
image: teogramm/koha:24.11
|
||||
ports:
|
||||
- 8080:8080
|
||||
- 8081:8081
|
||||
|
|
@ -23,14 +23,14 @@ services:
|
|||
- memcached
|
||||
|
||||
rabbitmq:
|
||||
image: rabbitmq
|
||||
image: docker.io/rabbitmq:3
|
||||
volumes:
|
||||
- ./.rabbitmq_plugins:/etc/rabbitmq/enabled_plugins
|
||||
- ./rabbitmq_plugins:/etc/rabbitmq/enabled_plugins
|
||||
networks:
|
||||
- koha
|
||||
|
||||
db:
|
||||
image: mariadb
|
||||
image: docker.io/mariadb:11
|
||||
volumes:
|
||||
- mariadb-koha:/var/lib/mysql
|
||||
environment:
|
||||
|
|
@ -42,7 +42,7 @@ services:
|
|||
- koha
|
||||
|
||||
memcached:
|
||||
image: memcached
|
||||
image: docker.io/memcached
|
||||
networks:
|
||||
- koha
|
||||
|
||||
|
|
|
|||
|
|
@ -10,5 +10,6 @@
|
|||
postrotate
|
||||
/command/s6-svc -h /run/service/apache2
|
||||
/command/s6-svc -r /run/service/plack
|
||||
/command/s6-svc -r /run/service/zebra-indexer
|
||||
endscript
|
||||
}
|
||||
|
|
|
|||
9
files/etc/s6-overlay/s6-rc.d/worker-long-tasks/run
Executable file
9
files/etc/s6-overlay/s6-rc.d/worker-long-tasks/run
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
#!/command/execlineb -P
|
||||
|
||||
fdmove -c 2 1
|
||||
|
||||
s6-envdir /etc/koha-envvars
|
||||
|
||||
s6-setuidgid default-koha
|
||||
|
||||
/usr/bin/perl /usr/share/koha/bin/workers/background_jobs_worker.pl --queue long_tasks
|
||||
1
files/etc/s6-overlay/s6-rc.d/worker-long-tasks/type
Normal file
1
files/etc/s6-overlay/s6-rc.d/worker-long-tasks/type
Normal file
|
|
@ -0,0 +1 @@
|
|||
longrun
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
#!/command/execlineb -P
|
||||
with-contenv
|
||||
|
||||
fdmove -c 2 1
|
||||
|
||||
|
|
@ -7,4 +6,4 @@ s6-envdir /etc/koha-envvars
|
|||
|
||||
s6-setuidgid default-koha
|
||||
|
||||
/usr/bin/perl /usr/share/koha/bin/background_jobs_worker.pl
|
||||
/usr/bin/perl /usr/share/koha/bin/workers/background_jobs_worker.pl
|
||||
|
|
|
|||
|
|
@ -1,4 +1,12 @@
|
|||
#!/command/execlineb -P
|
||||
with-contenv
|
||||
|
||||
importas -D "" elastic USE_ELASTICSEARCH
|
||||
|
||||
if -n { test "${elastic}" = "true" }
|
||||
|
||||
redirfd -a 1 /var/log/koha/default/zebra-indexer.log
|
||||
|
||||
fdmove -c 2 1
|
||||
|
||||
s6-envdir /etc/koha-envvars
|
||||
|
|
|
|||
|
|
@ -1,6 +1,14 @@
|
|||
#!/command/execlineb -P
|
||||
with-contenv
|
||||
|
||||
importas -D "" elastic USE_ELASTICSEARCH
|
||||
|
||||
if -n { test "${elastic}" = "true" }
|
||||
|
||||
fdmove -c 2 1
|
||||
|
||||
s6-envdir /etc/koha-envvars
|
||||
|
||||
s6-setuidgid default-koha
|
||||
|
||||
/usr/bin/zebrasrv -v 1 -f /etc/koha/sites/default/koha-conf.xml
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ MB_PARAMS="--mb-host ${MB_HOST} --mb-port ${MB_PORT} --mb-user ${MB_USER} --mb-p
|
|||
|
||||
# Configure the elasticsearch server
|
||||
ES_PARAMS=""
|
||||
if [[ "${ELASTICSEARCH_HOST}" != "" ]]
|
||||
if [[ "${USE_ELASTICSEARCH}" = "true" ]]
|
||||
then
|
||||
ES_PARAMS="--elasticsearch-server ${ELASTICSEARCH_HOST}"
|
||||
fi
|
||||
|
|
@ -45,12 +45,8 @@ else
|
|||
fi
|
||||
|
||||
# Configure search daemon
|
||||
if [ "${USE_ELASTICSEARCH}" != "true" ]
|
||||
if [ "${USE_ELASTICSEARCH}" = "true" ]
|
||||
then
|
||||
# Start zebra services with s6
|
||||
touch /etc/s6-overlay/s6-rc.d/user/contents.d/zebra-indexer
|
||||
touch /etc/s6-overlay/s6-rc.d/user/contents.d/zebra-server
|
||||
else
|
||||
koha-elasticsearch --rebuild -p $(grep -c ^processor /proc/cpuinfo) ${KOHA_INSTANCE} &
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue