This commit is contained in:
		@@ -20,8 +20,11 @@ jobs:
 | 
				
			|||||||
        run: docker build ./php-cli/ -t git.tgj.services/thatguyjack/php-cli:latest
 | 
					        run: docker build ./php-cli/ -t git.tgj.services/thatguyjack/php-cli:latest
 | 
				
			||||||
      - name: Build nginx-web
 | 
					      - name: Build nginx-web
 | 
				
			||||||
        run: docker build ./nginx-web -t git.tgj.services/thatguyjack/nginx-web:latest
 | 
					        run: docker build ./nginx-web -t git.tgj.services/thatguyjack/nginx-web:latest
 | 
				
			||||||
 | 
					      - name: Build motioneye
 | 
				
			||||||
 | 
					        run: docker build ./motioneye -t git.tgj.services/thatguyjack/motioneye:latest
 | 
				
			||||||
      - name: Push
 | 
					      - name: Push
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          docker push git.tgj.services/thatguyjack/php-fpm:latest
 | 
					          docker push git.tgj.services/thatguyjack/php-fpm:latest
 | 
				
			||||||
          docker push git.tgj.services/thatguyjack/php-cli:latest
 | 
					          docker push git.tgj.services/thatguyjack/php-cli:latest
 | 
				
			||||||
          docker push git.tgj.services/thatguyjack/nginx-web:latest
 | 
					          docker push git.tgj.services/thatguyjack/nginx-web:latest
 | 
				
			||||||
 | 
					          docker push git.tgj.services/thatguyjack/motioneye:latest
 | 
				
			||||||
							
								
								
									
										55
									
								
								motioneye/build/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								motioneye/build/Dockerfile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,55 @@
 | 
				
			|||||||
 | 
					FROM debian:bullseye-slim
 | 
				
			||||||
 | 
					LABEL maintainer="Jack Brierley <jack@thatguyjack.co.uk>"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# By default, run as root
 | 
				
			||||||
 | 
					ARG RUN_UID=0
 | 
				
			||||||
 | 
					ARG RUN_GID=0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#insure git is installed 
 | 
				
			||||||
 | 
					RUN apt-get update && apt install git cifs-utils -y
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#Clone and install Repo
 | 
				
			||||||
 | 
					RUN git clone -b dev https://github.com/motioneye-project/motioneye.git /tmp/motioneye
 | 
				
			||||||
 | 
					COPY entrypoint.sh /entrypoint.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					RUN case "$(dpkg --print-architecture)" in \
 | 
				
			||||||
 | 
					      'armhf') PACKAGES='python3-distutils'; printf '%b' '[global]\nextra-index-url=https://www.piwheels.org/simple/\n' > /etc/pip.conf;; \
 | 
				
			||||||
 | 
					      *) PACKAGES='gcc libcurl4-openssl-dev libssl-dev python3-dev';; \
 | 
				
			||||||
 | 
					    esac && \
 | 
				
			||||||
 | 
					    apt-get -q update && \
 | 
				
			||||||
 | 
					    DEBIAN_FRONTEND="noninteractive" apt-get -qq --option Dpkg::Options::="--force-confnew" --no-install-recommends install \
 | 
				
			||||||
 | 
					      ca-certificates curl python3 fdisk $PACKAGES && \
 | 
				
			||||||
 | 
					    curl -sSfO 'https://bootstrap.pypa.io/get-pip.py' && \
 | 
				
			||||||
 | 
					    python3 get-pip.py && \
 | 
				
			||||||
 | 
					    python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel && \
 | 
				
			||||||
 | 
					    python3 -m pip install --no-cache-dir /tmp/motioneye && \
 | 
				
			||||||
 | 
					    python3 -m pip install --no-cache-dir pytz && \
 | 
				
			||||||
 | 
					    motioneye_init --skip-systemd --skip-apt-update && \
 | 
				
			||||||
 | 
					    # Change uid/gid of user/group motion to match our desired IDs. This will
 | 
				
			||||||
 | 
					    # make it easier to use execute motion as our desired user later.
 | 
				
			||||||
 | 
					    sed -i "s/^\(motion:[^:]*\):[0-9]*:[0-9]*:\(.*\)/\1:${RUN_UID}:${RUN_GID}:\2/" /etc/passwd && \
 | 
				
			||||||
 | 
					    sed -i "s/^\(motion:[^:]*\):[0-9]*:\(.*\)/\1:${RUN_GID}:\2/" /etc/group && \
 | 
				
			||||||
 | 
					    mv /etc/motioneye/motioneye.conf /etc/motioneye.conf.sample && \
 | 
				
			||||||
 | 
					    mkdir /var/log/motioneye /var/lib/motioneye && \
 | 
				
			||||||
 | 
					    chown motion:motion /var/log/motioneye /var/lib/motioneye && \
 | 
				
			||||||
 | 
					    # Cleanup
 | 
				
			||||||
 | 
					    python3 -m pip uninstall -y pip setuptools wheel && \
 | 
				
			||||||
 | 
					    DEBIAN_FRONTEND="noninteractive" apt-get -qq autopurge $PACKAGES && \
 | 
				
			||||||
 | 
					    apt-get clean && \
 | 
				
			||||||
 | 
					    rm -r /var/lib/apt/lists /var/cache/apt /tmp/motioneye get-pip.py /root/.cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#Set timezone
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					RUN ln -snf /usr/share/zoneinfo/Europe/London /etc/localtime && echo $TZ > /etc/timezone
 | 
				
			||||||
 | 
					RUN date
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# R/W needed for motionEye to update configurations
 | 
				
			||||||
 | 
					VOLUME /etc/motioneye
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Video & images
 | 
				
			||||||
 | 
					VOLUME /var/lib/motioneye
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					EXPOSE 8765
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ENTRYPOINT ["/entrypoint.sh"]
 | 
				
			||||||
							
								
								
									
										6
									
								
								motioneye/build/entrypoint.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								motioneye/build/entrypoint.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
				
			|||||||
 | 
					#!/usr/bin/env sh
 | 
				
			||||||
 | 
					# We need to chown at startup time since volumes are mounted as root. This is fugly.
 | 
				
			||||||
 | 
					mkdir -p /run/motioneye
 | 
				
			||||||
 | 
					chown motion:motion /run/motioneye
 | 
				
			||||||
 | 
					[ -f '/etc/motioneye/motioneye.conf' ] || cp -a /etc/motioneye.conf.sample /etc/motioneye/motioneye.conf
 | 
				
			||||||
 | 
					exec su -g motion motion -s /bin/dash -c "LANGUAGE=en exec /usr/local/bin/meyectl startserver -c /etc/motioneye/motioneye.conf"
 | 
				
			||||||
		Reference in New Issue
	
	Block a user