Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-2883 Provide means to run server and webapp as persistent services in Docker container - install Nutch WebApp from separate repository (see NUTCH-2886) and run it via `mvn jetty:run -Djetty.port=<WEBAPP_PORT> - sync log paths in supervisord config files

Sebastian Nagel7c1a48cfad86
diff --git a/docker/Dockerfile b/docker/Dockerfile
index d58b583e6..cffa00a95 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -94,6 +94,12 @@ ENV SERVER_PORT=$SERVER_PORT
ENV SERVER_HOST=$SERVER_HOST
ENV WEBAPP_PORT=$WEBAPP_PORT
+# Install the webapp
+RUN apk --no-cache add maven
+RUN git clone https://github.com/apache/nutch-webapp.git nutch_webapp && \
+ cd nutch_webapp && \
+ mvn package
+
# Arrange necessary setup for supervisord
RUN mkdir -p /var/log/supervisord
COPY ./config/supervisord_startserver_webapp.conf /etc/supervisord.conf
diff --git a/docker/config/supervisord_startserver.conf b/docker/config/supervisord_startserver.conf
index f9b87b093..18ecc948d 100644
--- a/docker/config/supervisord_startserver.conf
+++ b/docker/config/supervisord_startserver.conf
@@ -15,7 +15,7 @@
[supervisord]
childlogdir=/var/log/supervisord/
-logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
+logfile=/var/log/supervisord/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
@@ -44,4 +44,4 @@ stdout_logfile=/var/log/supervisord/%(program_name)s_stdout.log
stdout_logfile_backups=5
stdout_logfile_maxbytes=10MB
#stdout_syslog=
-user=root
\ No newline at end of file
+user=root
diff --git a/docker/config/supervisord_startserver_webapp.conf b/docker/config/supervisord_startserver_webapp.conf
index 1b41f1cf1..25f653cda 100644
--- a/docker/config/supervisord_startserver_webapp.conf
+++ b/docker/config/supervisord_startserver_webapp.conf
@@ -49,7 +49,8 @@ user=root
[program:nutchwebapp]
autorestart=true
autostart=true
-command=nutch webapp -port %(ENV_WEBAPP_PORT)s
+directory=/root/nutch_webapp
+command=mvn jetty:run -Djetty.port=%(ENV_WEBAPP_PORT)s
environment=PATH=/usr/local/bin:%(ENV_PATH)s
process_name=%(program_name)s
numprocs=1