forked from aheimsbakk/container-munin
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
64 lines (48 loc) · 1.34 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM alpine:edge
ARG VERSION_ARG="0.0"
# Install packages
RUN apk --no-cache add \
coreutils \
dumb-init \
findutils \
logrotate \
munin \
munin-node \
nginx \
perl-cgi-fast \
procps \
rrdtool-cached \
spawn-fcgi \
sudo \
ttf-opensans \
tzdata && \
echo "$VERSION_ARG" > /run/version && \
rm -rf /var/cache/apk/*
# Create the user and group
# RUN addgroup -S munin && adduser -S munin -G munin
# Set munin crontab
RUN sed '/^[^*].*$/d; s/ munin //g' /etc/munin/munin.cron.sample | crontab -u munin -
# Default nginx.conf
COPY nginx.conf /etc/nginx/
# Copy munin config to nginx
COPY default.conf /etc/nginx/conf.d/
# Copy munin conf
COPY munin.conf /etc/munin/
# Start script with all processes
COPY docker-cmd.sh /
# Set execute permission
RUN chmod +x /docker-cmd.sh
# Logrotate script for munin logs
COPY munin /etc/logrotate.d/
# Expose volumes
VOLUME /etc/munin/munin-conf.d /etc/munin/plugin-conf.d /var/lib/munin /var/log/munin
# Expose NODES variable
ENV NODES=""
# Expose nginx
EXPOSE 80
# Healthcheck
HEALTHCHECK --interval=60s --retries=2 --timeout=10s CMD wget -nv -t1 --spider 'http://localhost:80/munin/' || exit 1
# Use dumb-init since we run a lot of processes
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
# Run start script or what you choose
CMD ["/bin/bash", "/docker-cmd.sh"]