Commit 0cdcb53b authored by Gaël Berthaud-Müller's avatar Gaël Berthaud-Müller
Browse files

update dockerfile

parent 71d8d760
FROM zonemaster/engine:local as build
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND noninteractive
RUN apk add --no-cache \
build-base \
make \
perl-dev \
perl-lwp-protocol-https \
#
perl-app-cpanminus \
perl-class-method-modifiers \
perl-config-inifiles \
perl-dbd-sqlite \
perl-dbi \
perl-file-sharedir \
perl-file-slurp \
perl-html-parser \
perl-mojolicious \
perl-io-stringy \
perl-libwww \
jq \
perl-log-any \
perl-log-dispatch \
perl-moose \
perl-parallel-forkmanager \
perl-plack \
perl-role-tiny \
perl-string-shellquote \
perl-try-tiny \
perl-net-server \
perl-role-tiny \
perl-test-nowarnings \
perl-test-nowarnings \
perl-test-simple \
RUN apt-get update && \
apt-get install --yes autoconf automake build-essential cpanminus libclass-accessor-perl libclone-perl libdevel-checklib-perl libemail-valid-perl libfile-sharedir-perl libfile-slurp-perl libidn11-dev libintl-perl libio-socket-inet6-perl libjson-pp-perl liblist-moreutils-perl libmodule-find-perl libmodule-install-perl libmodule-install-xsutil-perl libmoose-perl libmoosex-singleton-perl libnet-ip-perl libpod-coverage-perl libreadonly-xs-perl libssl-dev libtest-differences-perl libtest-exception-perl libtest-fatal-perl libtest-nowarnings-perl libtest-pod-perl libtext-csv-perl libtool m4 && \
cpanm Module::Install::XSUtil MooseX::Singleton && \
cpanm -n Zonemaster::LDNS
&& cpanm --no-wget --from=https://cpan.metacpan.org/ --notest \
Daemon::Control \
JSON::Validator \
JSON::PP \
Module::Find \
Plack::Middleware::ReverseProxy \
Starman \
Log::Any::Adapter::Dispatch \
Plack::Test \
String::ShellQuote \
JSON::RPC \
Router::Simple \
Net::Statsd
RUN apt-get install -y jq libclass-method-modifiers-perl libconfig-inifiles-perl libdbd-sqlite3-perl libdaemon-control-perl libdbi-perl libfile-sharedir-perl libfile-slurp-perl libhtml-parser-perl libmojolicious-perl libio-stringy-perl libjson-pp-perl libjson-rpc-perl libjson-validator-perl liblog-any-adapter-dispatch-perl liblog-any-perl liblog-dispatch-perl libmoose-perl libparallel-forkmanager-perl libplack-perl libplack-middleware-debug-perl libplack-middleware-reverseproxy-perl librole-tiny-perl librouter-simple-perl libstring-shellquote-perl libtest-nowarnings-perl libtry-tiny-perl libintl-perl perl-doc starman libdbd-pg-perl libnet-statsd-perl && \
cpanm -n JSON::Validator
ARG version
COPY ./Zonemaster-Backend.tar.gz ./Zonemaster-Backend.tar.gz
COPY ./Zonemaster-Engine.tar.gz ./Zonemaster-Engine.tar.gz
COPY ./Zonemaster-Backend-${version}.tar.gz ./Zonemaster-Backend-${version}.tar.gz
RUN cpanm --notest --no-wget \
./Zonemaster-Backend-${version}.tar.gz
FROM zonemaster/engine:local
EXPOSE 5000
VOLUME /etc/zonemaster
RUN apk add --no-cache \
# All the locales we need and more
musl-locales \
jq \
# Run-time dependencies
perl-class-method-modifiers \
perl-config-inifiles \
perl-dbd-sqlite \
perl-dbd-pg \
perl-dbi \
perl-file-sharedir \
perl-file-slurp \
perl-html-parser \
perl-mojolicious \
perl-io-stringy \
perl-libwww \
perl-log-any \
perl-log-dispatch \
perl-moose \
perl-parallel-forkmanager \
perl-plack \
perl-role-tiny \
perl-string-shellquote \
perl-try-tiny \
perl-net-server \
perl-role-tiny
COPY --from=build /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/site_perl
COPY --from=build /usr/local/share/perl5/site_perl /usr/local/share/perl5/site_perl
COPY --from=build /usr/local/bin/zonemaster_backend_testagent /usr/local/bin/zonemaster_backend_testagent
COPY --from=build /usr/local/bin/zonemaster_backend_rpcapi.psgi /usr/local/bin/zonemaster_backend_rpcapi.psgi
RUN cpanm -n ./Zonemaster-Engine.tar.gz ./Zonemaster-Backend.tar.gz
......@@ -126,11 +126,13 @@ sub main {
my $catch_sigterm;
$catch_sigterm = sub {
$SIG{TERM} = $catch_sigterm;
$SIG{INT} = $catch_sigterm;
$caught_sigterm = 1;
$log->notice( "Daemon caught SIGTERM" );
return;
};
local $SIG{TERM} = $catch_sigterm;
local $SIG{INT} = $catch_sigterm;
my $agent = Zonemaster::Backend::TestAgent->new( { config => $self->config } );
# Disconnect from database in parent to avoid sharing the connection between children
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment