Mason James
3 years ago
2 changed files with 181 additions and 0 deletions
@ -0,0 +1,171 @@ |
|||
# Base it on Ubuntu 21.04 |
|||
FROM ubuntu:21.04 |
|||
|
|||
# File Author / Maintainer |
|||
LABEL maintainer="tomascohen@theke.io" |
|||
|
|||
ENV PATH /usr/bin:/bin:/usr/sbin:/sbin |
|||
ENV DEBIAN_FRONTEND noninteractive |
|||
|
|||
ENV REFRESHED_AT 2021-04-22-1 |
|||
|
|||
# Install apache2 and testting deps |
|||
# netcat: used for checking the DB is up |
|||
RUN apt-get -y update \ |
|||
&& apt-get -y install \ |
|||
apache2 \ |
|||
build-essential \ |
|||
codespell \ |
|||
cpanminus \ |
|||
git \ |
|||
tig \ |
|||
libcarp-always-perl \ |
|||
libgit-repository-perl \ |
|||
liblist-compare-perl \ |
|||
libmemcached-tools \ |
|||
libmodule-install-perl \ |
|||
libperl-critic-perl \ |
|||
libsmart-comments-perl \ |
|||
libtest-differences-perl \ |
|||
libtest-perl-critic-perl \ |
|||
libtest-perl-critic-progressive-perl \ |
|||
libfile-chdir-perl \ |
|||
libdata-printer-perl \ |
|||
pmtools \ |
|||
locales \ |
|||
netcat \ |
|||
python-gdbm \ |
|||
vim \ |
|||
tmux \ |
|||
wget \ |
|||
curl \ |
|||
apt-transport-https \ |
|||
mlocate \ |
|||
&& rm -rf /var/cache/apt/archives/* \ |
|||
&& rm -rf /var/lib/apt/lists/* |
|||
|
|||
# Temporary dependencies |
|||
RUN apt-get -y update \ |
|||
&& apt-get -y install \ |
|||
libplack-middleware-logwarn-perl \ |
|||
libemail-stuffer-perl \ |
|||
&& rm -rf /var/cache/apt/archives/* \ |
|||
&& rm -rf /var/lib/apt/lists/* |
|||
|
|||
# Set locales |
|||
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ |
|||
&& echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen \ |
|||
&& locale-gen \ |
|||
&& dpkg-reconfigure locales \ |
|||
&& /usr/sbin/update-locale LANG=en_US.UTF-8 |
|||
|
|||
ENV LANGUAGE en_US.UTF-8 |
|||
ENV LANG en_US.UTF-8 |
|||
ENV LC_ALL en_US.UTF-8 |
|||
ENV LC_CTYPE en_US.UTF-8 |
|||
|
|||
# Prepare apache configuration |
|||
RUN a2dismod mpm_event |
|||
RUN a2dissite 000-default |
|||
RUN a2enmod rewrite \ |
|||
headers \ |
|||
proxy_http \ |
|||
cgi |
|||
|
|||
# Add Koha development repositories |
|||
RUN echo "deb http://debian.koha-community.org/koha-staging dev main" >> /etc/apt/sources.list.d/koha.list |
|||
RUN wget -q -O- http://debian.kohaaloha.com/koha/gpg.asc | apt-key add - |
|||
|
|||
# Install koha-common |
|||
RUN apt-get -y update \ |
|||
&& apt-get -y install \ |
|||
koha-common \ |
|||
&& /etc/init.d/koha-common stop \ |
|||
&& rm -rf /var/cache/apt/archives/* \ |
|||
&& rm -rf /var/lib/api/lists/* |
|||
|
|||
RUN mkdir /kohadevbox |
|||
WORKDIR /kohadevbox |
|||
|
|||
# Install testing extras, packages and cpan |
|||
RUN apt-get -y update \ |
|||
&& apt-get -y install \ |
|||
libexpat1-dev \ |
|||
libtemplate-plugin-gettext-perl \ |
|||
&& rm -rf /var/cache/apt/archives/* \ |
|||
&& rm -rf /var/lib/api/lists/* |
|||
|
|||
RUN cpanm -i --force \ |
|||
DBD::SQLite \ |
|||
HTTPD::Bench::ApacheBench \ |
|||
MooseX::Attribute::ENV \ |
|||
Test::DBIx::Class \ |
|||
TAP::Harness::JUnit \ |
|||
Text::CSV::Unicode \ |
|||
Devel::Cover::Report::Clover \ |
|||
WebService::ILS \ |
|||
Selenium::Remote::Driver |
|||
|
|||
# Patch Devel::Cover to skip exec |
|||
RUN wget -O Devel-Cover.tar.gz \ |
|||
http://search.cpan.org/CPAN/authors/id/P/PJ/PJCJ/Devel-Cover-1.26.tar.gz \ |
|||
&& tar xvzf Devel-Cover.tar.gz \ |
|||
&& sed -i 's/PL_ppaddr\[OP_EXEC\] = dc_exec;//' Devel-Cover-1.26/Cover.xs \ |
|||
&& cd Devel-Cover-1.26/ \ |
|||
&& cpanm -i -n . |
|||
|
|||
## Add Yarn |
|||
# Add node repo |
|||
RUN wget -q -O- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - |
|||
RUN echo "deb http://deb.nodesource.com/node_12.x hirsute main" > /etc/apt/sources.list.d/node.list |
|||
# Add yarn repo |
|||
RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - |
|||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list |
|||
# Install Node.js and Yarn |
|||
RUN apt-get update \ |
|||
&& apt-get -y install nodejs yarn \ |
|||
&& rm -rf /var/cache/apt/archives/* \ |
|||
&& rm -rf /var/lib/api/lists/* |
|||
|
|||
# Install gulp |
|||
RUN npm install gulp-cli -g |
|||
|
|||
# Add git-bz |
|||
RUN cd /usr/local/share \ |
|||
&& git clone --depth 1 --branch apply_on_cascade https://gitlab.com/koha-community/git-bz git-bz \ |
|||
&& ln -s /usr/local/share/git-bz/git-bz /usr/bin/git-bz |
|||
|
|||
# Clone helper repositories |
|||
RUN cd /kohadevbox \ |
|||
&& git clone https://gitlab.com/koha-community/koha-misc4dev.git misc4dev \ |
|||
&& git clone https://gitlab.com/koha-community/koha-gitify.git gitify \ |
|||
&& git clone https://gitlab.com/koha-community/qa-test-tools.git |
|||
|
|||
# release-tools |
|||
RUN cd /kohadevbox \ |
|||
&& git clone https://gitlab.com/koha-community/release-tools.git \ |
|||
&& apt-get update \ |
|||
&& apt-get -y install \ |
|||
libhtml-tableextract-perl \ |
|||
libtext-multimarkdown-perl \ |
|||
&& rm -rf /var/cache/apt/archives/* \ |
|||
&& rm -rf /var/lib/api/lists/* \ |
|||
&& cpanm -i --force \ |
|||
File::FindLib \ |
|||
REST::Client |
|||
|
|||
# Remote debugger |
|||
RUN cd /kohadevbox \ |
|||
&& wget -q -O dbgp.tar.gz http://cloud.theke.io/index.php/s/pEgS35T3MktNffk/download \ |
|||
&& tar xvzf dbgp.tar.gz \ |
|||
&& rm dbgp.tar.gz |
|||
|
|||
VOLUME /kohadevbox/koha |
|||
|
|||
COPY files/run.sh /kohadevbox |
|||
COPY files/templates /kohadevbox/templates |
|||
COPY env/defaults.env /kohadevbox/templates/defaults.env |
|||
|
|||
CMD ["/bin/bash", "/kohadevbox/run.sh"] |
|||
|
|||
EXPOSE 8080 8081 |
Loading…
Reference in new issue