-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (48 loc) · 1.49 KB
/
Dockerfile
File metadata and controls
58 lines (48 loc) · 1.49 KB
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
FROM debian:bullseye-slim
# NOTE: This Dockerfile builds Monit from source for testing purposes.
# For production use, download a pre-built Monit binary to significantly reduce
# the container size and avoid including build dependencies. Consider using
# Alpine Linux as the base image for even smaller containers.
# See https://mmonit.com/monit/#download
# Install necessary packages for building Monit (SSL and Pam are optional)
RUN apt-get update && \
apt-get install -y \
zlib1g-dev \
libpam0g-dev \
libssl-dev \
libtool \
bison \
flex \
autoconf \
gcc \
make \
git \
procps \
&& rm -rf /var/lib/apt/lists/*
# Clone and build the latest Monit
WORKDIR /tmp
RUN git clone https://bitbucket.org/tildeslash/monit.git && \
cd monit && \
./bootstrap && \
./configure && \
make && \
make install && \
cd .. && \
rm -rf monit
# Create directories
RUN mkdir -p /var/lib/monit /usr/local/bin /var/log
# Copy the test scripts
COPY scripts/program.sh /usr/local/bin/
COPY scripts/process.sh /usr/local/bin/
COPY scripts/check_zombies.sh /usr/local/bin/
COPY monitrc /etc/monitrc
# Set proper permissions for monitrc (required by Monit)
RUN chmod 600 /etc/monitrc
# Make scripts executable
RUN chmod +x /usr/local/bin/*.sh
# Create a directory for result files
RUN mkdir -p /results
# Expose port if you want to use the web interface
EXPOSE 2812
# Set Monit as the entrypoint (PID 1)
ENTRYPOINT ["/usr/local/bin/monit", "-I", "-c", "/etc/monitrc"]