-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (22 loc) · 849 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
# use most optimized base image
FROM alpine:latest
# that's me ;-)
LABEL maintainer="extrafein"
# get value from docker-compose.yaml
ARG architecture
# prepare variable
ARG latest_version
RUN apk add --no-cache curl linux-pam
# prepare app directory
RUN mkdir /app
WORKDIR /app
# evaluate latest monit version and download it
RUN export latest_version=$(curl -s "https://mmonit.com/monit/dist/binary/" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n1) \
&& curl -sL "https://mmonit.com/monit/dist/binary/$latest_version/monit-$latest_version-$architecture.tar.gz" | tar -xz --strip-components=1
RUN chmod 755 /app/bin/monit
# expose port for monit
EXPOSE 2812
# set basic healthcheck
HEALTHCHECK CMD curl -f http://localhost:2812 || exit 1
# set start command for container
CMD ["/app/bin/monit","-c","/app/conf/monitrc","-I"]