Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

https://github.com/ccrisan/motioneye/wiki/Install-In-Docker

https://hub.docker.com/r/ccrisan/motioneye/tags

compose:

WD=/opt/motioneye
mkdir -p $WD/{lib,setup,conf}
cd $WD/setup
cat << 'EOF' >docker-compose.yaml
version: '3.7'

services:
 motioneye:
    container_name: motioneye
    image: ccrisan/motioneye:master-amd64
    hostname: motioneye
    ports:
      - 8765:8765
    volumes:
      - type: bind
        source: /opt/motioneye/conf/
        target: /etc/motioneye
      - type: bind
        source: /opt/motioneye/lib/
        target: /var/lib/motioneye
      - type: bind
        source: /etc/localtime
        target: /etc/localtime
        read_only: true

    environment:
      - 'TZ=America/Whitehorse'

EOF
chmod +x docker-compose.yaml

systemd:

WD=/opt/motioneye/setup
cat << EOF >$WD/motioneye.service.setup.sh
cat << EOL >/lib/systemd/system/motioneye.service
[Unit]
Description=motioneye_Docker
Requires=docker.service network-online.target

[Service]

Restart=on-abnormal
ExecStart=/usr/bin/docker-compose --project-name motioneye --project-directory $WD -f $WD/docker-compose.yaml up
ExecStop=/usr/bin/docker-compose --project-name motioneye --project-directory $WD -f $WD/docker-compose.yaml stop

[Install]
WantedBy=multi-user.target
EOL
systemctl enable motioneye
systemctl restart motioneye
systemctl status motioneye
EOF
chmod +x $WD/motioneye.service.setup.sh
$WD/motioneye.service.setup.sh

bash alias:

echo 'alias motioneyecli="docker exec -it motioneye /bin/bash"' >> ~/.bashrc
source ~/.bashrc
  • No labels