Skip to content

Commit

Permalink
Merge pull request #4066 from jamesachamp/3720/bug/manage-solr-logs
Browse files Browse the repository at this point in the history
3720/bug/manage solr logs
  • Loading branch information
cdrini authored Nov 20, 2020
2 parents e17c19c + 0fb4ff3 commit 8fcb4b8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions conf/solr/rmlog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
find /var/log/tomcat7/* -mtime +7 -exec rm {} \;
3 changes: 2 additions & 1 deletion conf/solr/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

# Start cron for log management
cron start
# Default to dev env
ENV=${ENV:-dev}
# How much memory to use
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ services:
- solr-data:/var/lib/solr/data
networks:
- webnet
logging:
options:
max-size: "512m"
max-file: "4"
memcached:
image: memcached
networks:
Expand Down
6 changes: 5 additions & 1 deletion docker/Dockerfile.olsolr
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
FROM ubuntu:xenial

RUN apt-get -qq update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y solr-tomcat haproxy && \
DEBIAN_FRONTEND=noninteractive apt-get install -y solr-tomcat haproxy cron && \
ln -s /var/log/tomcat7/ /usr/share/tomcat7/logs && \
ln -s /etc/tomcat7/ /usr/share/tomcat7/conf

COPY conf/solr/conf/* /etc/solr/conf/
COPY conf/solr/haproxy.cfg /etc/haproxy/
COPY conf/solr/start.sh /start.sh

# Log management:
COPY conf/solr/rmlog.sh /etc/cron.daily/rmlog
RUN crontab /etc/crontab

EXPOSE 8983
CMD /start.sh

0 comments on commit 8fcb4b8

Please sign in to comment.