Add docker compose file

This commit is contained in:
Luis Miguel Vicente Fuentes 2018-03-03 13:09:49 +01:00
parent 4a7d88d537
commit 62c07bafba
2 changed files with 17 additions and 1 deletions

View File

@ -10,6 +10,8 @@ Run Monit inside docker.
Install docker: https://docs.docker.com/engine/installation/ Install docker: https://docs.docker.com/engine/installation/
Install docker compose: https://docs.docker.com/compose/install/
Docker documentation: https://docs.docker.com/ Docker documentation: https://docs.docker.com/
### Build-in docker image ### Build-in docker image
@ -22,7 +24,7 @@ Docker documentation: https://docs.docker.com/
- pull docker image from docker hub: `docker pull kijart/monit` - pull docker image from docker hub: `docker pull kijart/monit`
- download a video using docker image: `docker run -ti -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc kijart/monit` - start monit: `docker run -ti -p 2812:2812 -v $(pwd)/monitrc:/etc/monitrc kijart/monit`
- create a docker container: - create a docker container:
@ -34,6 +36,12 @@ docker create \
kijart/monit kijart/monit
``` ```
### Docker compose
- create a container using docker-compose: `docker-compose up --no-start`
- start monit: `docker-compose up`
### Troubleshooting ### Troubleshooting
If when starting Monit returns the following message: `The control file '/etc/monitrc' permission 0755 is wrong, maximum 0700 allowed`, simply give the appropriate permissions to _monitrc_: `chmod 700 monitrc`. If when starting Monit returns the following message: `The control file '/etc/monitrc' permission 0755 is wrong, maximum 0700 allowed`, simply give the appropriate permissions to _monitrc_: `chmod 700 monitrc`.

8
docker-compose.yml Normal file
View File

@ -0,0 +1,8 @@
version: '3'
services:
monit:
image: "kijart/monit"
ports:
- 2812:2812
volumes:
- ./monitrc:/etc/monitrc