Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: diogopms/monit-docker
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: barcar/monit-docker
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Sep 11, 2022

  1. Update Dockerfile

    barcar authored Sep 11, 2022
    Copy the full SHA
    c55bb0f View commit details
  2. Update docker-compose.yaml

    barcar authored Sep 11, 2022
    Copy the full SHA
    fb8e0cd View commit details
  3. Update Dockerfile

    barcar authored Sep 11, 2022
    Copy the full SHA
    ea5b266 View commit details
  4. Update docker-compose.yaml

    barcar authored Sep 11, 2022
    Copy the full SHA
    ef70066 View commit details
  5. Update Dockerfile

    barcar authored Sep 11, 2022
    Copy the full SHA
    fc8f511 View commit details
  6. Update docker-compose.yaml

    barcar authored Sep 11, 2022
    Copy the full SHA
    0fdf1be View commit details
  7. .

    barcar committed Sep 11, 2022
    Copy the full SHA
    57c45c4 View commit details
  8. build latest

    barcar committed Sep 11, 2022
    Copy the full SHA
    4604425 View commit details
  9. using pre-compiled binaries

    barcar committed Sep 11, 2022
    Copy the full SHA
    7bc25cb View commit details
  10. added pushover variables

    barcar committed Sep 11, 2022
    Copy the full SHA
    d182600 View commit details

Commits on Sep 21, 2022

  1. Update Dockerfile

    barcar authored Sep 21, 2022
    Copy the full SHA
    85737d6 View commit details
  2. Update docker-compose.yaml

    barcar authored Sep 21, 2022
    Copy the full SHA
    b8854bb View commit details

Commits on Oct 2, 2022

  1. Update docker-entrypoint.sh

    barcar authored Oct 2, 2022
    Copy the full SHA
    50ebc4a View commit details

Commits on Oct 16, 2022

  1. Update docker-compose.yaml

    barcar authored Oct 16, 2022
    Copy the full SHA
    38cbc2a View commit details

Commits on Oct 18, 2022

  1. Update docker-compose.yaml

    barcar authored Oct 18, 2022
    Copy the full SHA
    8a0625a View commit details

Commits on Nov 18, 2022

  1. Update docker-compose.yaml

    barcar authored Nov 18, 2022
    Copy the full SHA
    4fd4646 View commit details

Commits on Nov 19, 2022

  1. Update docker-compose.yaml

    barcar authored Nov 19, 2022
    Copy the full SHA
    04798db View commit details

Commits on Nov 22, 2022

  1. Update docker-entrypoint.sh

    barcar authored Nov 22, 2022
    Copy the full SHA
    4844787 View commit details

Commits on Dec 13, 2022

  1. Update docker-compose.yaml

    barcar authored Dec 13, 2022
    Copy the full SHA
    40bbd57 View commit details
  2. Update docker-compose.yaml

    barcar authored Dec 13, 2022
    Copy the full SHA
    21bf410 View commit details
  3. Update Dockerfile

    barcar authored Dec 13, 2022
    Copy the full SHA
    1b7b74a View commit details

Commits on Apr 22, 2023

  1. Update docker-compose.yaml

    barcar authored Apr 22, 2023
    Copy the full SHA
    22d7446 View commit details
Showing with 40 additions and 18 deletions.
  1. +14 −13 Dockerfile
  2. +22 −5 docker-compose.yaml
  3. +4 −0 docker-entrypoint.sh
27 changes: 14 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
FROM alpine:3.16.0

LABEL maintainer="Diogo Serrano <info@diogoserrano.com>"
FROM debian:bullseye-slim

# monit environment variables
ENV MONIT_VERSION=5.26.0 \
ENV MONIT_VERSION=5.32.0 \
MONIT_ARCH=arm64 \
MONIT_HOME=/opt/monit \
MONIT_URL=https://mmonit.com/monit/dist \
MONIT_URL=https://mmonit.com/monit/dist/binary \
PATH=$PATH:/opt/monit/bin

COPY slack /bin/slack
COPY pushover /bin/pushover

# Install monit
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get install wget curl docker.io mosquitto-clients python3 -y

# Compile and install monit
RUN \
apk add --update gcc musl-dev make bash python3 curl libressl-dev file zlib-dev && \
mkdir -p /opt/src; cd /opt/src && \
wget -qO- ${MONIT_URL}/monit-${MONIT_VERSION}.tar.gz | tar xz && \
cd /opt/src/monit-${MONIT_VERSION} && \
./configure --prefix=${MONIT_HOME} --without-pam && \
make && make install && \
apk del gcc musl-dev make file zlib-dev && \
rm -rf /var/cache/apk/* /opt/src
wget ${MONIT_URL}/${MONIT_VERSION}/monit-${MONIT_VERSION}-linux-${MONIT_ARCH}.tar.gz && \
tar zxvf monit-${MONIT_VERSION}-linux-${MONIT_ARCH}.tar.gz && \
cd monit-${MONIT_VERSION} && \
cp bin/monit /usr/local/bin/ && \
cp conf/monitrc /etc/

EXPOSE 2812

27 changes: 22 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -2,14 +2,31 @@
version: "3.8"
services:
monit:
image: diogopms/monit-docker-kubernetes:latest
build: .
pull_policy: build
container_name: monit
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Lisbon
- TZ=Europe/London
- PUSH_OVER_TOKEN=${PUSH_OVER_TOKEN}
- PUSH_OVER_USER=${PUSH_OVER_USER}
- SLACK_URL=${SLACK_URL}
- MQTT_HOST=${MQTT_HOST}
- MQTT_USER=${MQTT_USER}
- MQTT_PASSWORD=${MQTT_PASSWORD}
- DEBUG=${DEBUG}
volumes:
- ./monitrc:/etc/monitrc
ports:
- 2812:2812
- monit_data:/mnt
- /var/lib/docker/volumes/monit_data/_data/monitrc:/etc/monitrc
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
network_mode: host
# ports:
# - 2812:2812
restart: unless-stopped
# labels:
# - "com.centurylinklabs.watchtower.enable=true"
volumes:
monit_data:
external: true
4 changes: 4 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/bin/sh

echo "Setting up monitrc"
chmod 700 /etc/monitrc
cp /etc/monitrc /etc/monitrc_root
chown root:root /etc/monitrc_root

echo "Removing prior PID file"
rm -f /var/run/monit.pid

if [ "$DEBUG" = "1" ]
then
exec monit -I -B -v -c /etc/monitrc_root