-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
34 lines (26 loc) · 851 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM debian:jessie
MAINTAINER Michal Raczka [email protected]
# set default configuration
ENV DOCKER_DIR /var/lib/docker/
ENV GOCRON_SCHEDULER 0 0 * * * *
ENV LOGROTATE_MODE daily
ENV LOGROTATE_ROTATE 7
ENTRYPOINT [ "/bin/bash" ]
CMD [ "/app/start" ]
WORKDIR /app
# install curl
RUN apt-get update \
&& apt-get install -y curl logrotate \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# install go-cron
RUN curl -sL https://github.com/michaloo/go-cron/releases/download/v0.0.2/go-cron.tar.gz \
| tar -x -C /usr/local/bin
# clear logrotate default configuration and modify logrotate script
# add the template and enable debug mode
RUN rm /etc/logrotate.d/* \
&& sed -i \
-e 's/^\/usr\/sbin\/logrotate.*/\/usr\/sbin\/logrotate \-v \/etc\/logrotate.conf/' \
/etc/cron.daily/logrotate
# copy project files
ADD . /app