Skip to content

Commit

Permalink
⚙️🆕 logrotate
Browse files Browse the repository at this point in the history
  • Loading branch information
bscheshirwork committed Mar 15, 2017
1 parent 9fe4151 commit 715cc5b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ ENV MYSQL_PROXY_VERSION 0.8.5
ENV MYSQL_PROXY_TAR_NAME mysql-proxy-$MYSQL_PROXY_VERSION-linux-debian6.0-x86-64bit

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install wget && \
DEBIAN_FRONTEND=noninteractive apt-get -y install \
logrotate \
wget && \
wget https://downloads.mysql.com/archives/get/file/$MYSQL_PROXY_TAR_NAME.tar.gz && \
tar -xzvf $MYSQL_PROXY_TAR_NAME.tar.gz && \
mv $MYSQL_PROXY_TAR_NAME /opt/mysql-proxy && \
Expand All @@ -17,6 +19,21 @@ RUN apt-get update && \
chown -R root:root /opt/mysql-proxy
RUN echo "#!/bin/bash\n\
\n\
cat >/etc/logrotate.d/mysql-proxy <<.\n\
\"\${LOG_FILE}\" {\n\
weekly\n\
missingok\n\
rotate 24\n\
compress\n\
delaycompress\n\
notifempty\n\
create 666 root root\n\
postrotate\n\
/etc/init.d/mysql-proxy reload > /dev/null\n\
endscript\n\
}\n\
.\n\
\n\
exec /opt/mysql-proxy/bin/mysql-proxy \\\\\n\
--keepalive \\\\\n\
--log-level=debug \\\\\n\
Expand Down

0 comments on commit 715cc5b

Please sign in to comment.