diff --git a/3.7/Dockerfile b/3.7/Dockerfile index 85c33ad3..7c67cb4f 100644 --- a/3.7/Dockerfile +++ b/3.7/Dockerfile @@ -120,6 +120,10 @@ COPY start.sh /app/start.sh COPY startapache.sh /app/startapache.sh COPY startpostgres.sh /app/startpostgres.sh +# Supervisor +RUN apt-get -y update -qq && apt-get -y install supervisor && apt-get clean +COPY conf.d/replication.conf /etc/supervisor/conf.d/replication.conf + # Collapse image to single layer. FROM scratch diff --git a/3.7/conf.d/replication.conf b/3.7/conf.d/replication.conf new file mode 100644 index 00000000..5eb06d7f --- /dev/null +++ b/3.7/conf.d/replication.conf @@ -0,0 +1,11 @@ +[program:replication] +command=nominatim replication --project-dir /nominatim +user=nominatim +process_name=%(program_name)s_%(process_num)02d +numprocs=1 +autostart=true +autorestart=true +startsecs=0 +redirect_stderr=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 diff --git a/3.7/start.sh b/3.7/start.sh index 52a7e3c1..3f0cabae 100755 --- a/3.7/start.sh +++ b/3.7/start.sh @@ -27,6 +27,7 @@ cd ${PROJECT_DIR} && nominatim refresh --website service postgresql start service apache2 start +service supervisor start # fork a process and wait for it tail -f /var/log/postgresql/postgresql-12-main.log & diff --git a/4.0/Dockerfile b/4.0/Dockerfile index b6b5088d..5bf0155d 100644 --- a/4.0/Dockerfile +++ b/4.0/Dockerfile @@ -121,6 +121,10 @@ COPY start.sh /app/start.sh COPY startapache.sh /app/startapache.sh COPY startpostgres.sh /app/startpostgres.sh +# Supervisor +RUN apt-get -y update -qq && apt-get -y install supervisor && apt-get clean +COPY conf.d/replication.conf /etc/supervisor/conf.d/replication.conf + # Collapse image to single layer. FROM scratch diff --git a/4.0/conf.d/replication.conf b/4.0/conf.d/replication.conf new file mode 100644 index 00000000..5eb06d7f --- /dev/null +++ b/4.0/conf.d/replication.conf @@ -0,0 +1,11 @@ +[program:replication] +command=nominatim replication --project-dir /nominatim +user=nominatim +process_name=%(program_name)s_%(process_num)02d +numprocs=1 +autostart=true +autorestart=true +startsecs=0 +redirect_stderr=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 diff --git a/4.0/start.sh b/4.0/start.sh index 263e35e5..bc4cab75 100755 --- a/4.0/start.sh +++ b/4.0/start.sh @@ -41,6 +41,7 @@ service postgresql start cd ${PROJECT_DIR} && sudo -E -u nominatim nominatim refresh --website --functions service apache2 start +service supervisor start # fork a process and wait for it tail -f /var/log/postgresql/postgresql-12-main.log &