| 
									
										
										
										
											2024-11-28 17:57:51 +00:00
										 |  |  | FROM alpine:3.20 | 
					
						
							| 
									
										
										
										
											2024-02-14 21:47:41 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2018-03-25 18:35:32 +00:00
										 |  |  | # Include dist | 
					
						
							| 
									
										
										
										
											2022-03-08 23:36:03 +00:00
										 |  |  | COPY dist/ /root/dist/ | 
					
						
							| 
									
										
										
										
											2019-10-16 14:46:58 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2018-03-25 18:35:32 +00:00
										 |  |  | # Install packages | 
					
						
							| 
									
										
										
										
											2024-12-05 21:39:01 +00:00
										 |  |  | RUN apk --no-cache -U upgrade && \ | 
					
						
							|  |  |  | 	apk --no-cache -U add \ | 
					
						
							| 
									
										
										
										
											2024-02-28 18:07:22 +00:00
										 |  |  | 		build-base \ | 
					
						
							|  |  |  | 		git \ | 
					
						
							|  |  |  | 		libcap \ | 
					
						
							|  |  |  | 		libffi-dev \ | 
					
						
							|  |  |  | 		openssl-dev \ | 
					
						
							|  |  |  | 		py3-pyzmq \ | 
					
						
							|  |  |  | 		postgresql-dev \ | 
					
						
							|  |  |  | 		py3-attrs \ | 
					
						
							|  |  |  | 		py3-mysqlclient \ | 
					
						
							|  |  |  | 		py3-nose \ | 
					
						
							|  |  |  | 		py3-pip \ | 
					
						
							|  |  |  | 		py3-psycopg2 \ | 
					
						
							|  |  |  | 		py3-pycryptodome \ | 
					
						
							|  |  |  | 		py3-pyzmq \ | 
					
						
							|  |  |  | 		py3-requests \ | 
					
						
							|  |  |  | 		py3-rsa \ | 
					
						
							|  |  |  | 		py3-typing-extensions \ | 
					
						
							|  |  |  | 		py3-wheel \ | 
					
						
							|  |  |  | 		py3-yaml \ | 
					
						
							|  |  |  | 		python3 \ | 
					
						
							|  |  |  | 		python3-dev && \ | 
					
						
							| 
									
										
										
										
											2019-10-16 14:46:58 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2018-03-25 18:35:32 +00:00
										 |  |  | # Setup heralding | 
					
						
							|  |  |  |     mkdir -p /opt && \ | 
					
						
							|  |  |  |     cd /opt/ && \ | 
					
						
							| 
									
										
										
										
											2024-11-28 17:57:51 +00:00
										 |  |  |     git clone https://github.com/johnnykv/heralding && \ | 
					
						
							| 
									
										
										
										
											2018-03-25 18:35:32 +00:00
										 |  |  |     cd heralding && \ | 
					
						
							| 
									
										
										
										
											2024-11-28 17:57:51 +00:00
										 |  |  |     git checkout ac12724ab38c4e2fe78f07d1bc35e6e586ba69c0 && \ | 
					
						
							| 
									
										
										
										
											2022-03-12 17:59:31 +00:00
										 |  |  |     cp /root/dist/requirements.txt . && \ | 
					
						
							| 
									
										
										
										
											2024-12-05 21:39:01 +00:00
										 |  |  |     pip3 install --break-system-packages --no-cache-dir --upgrade pip && \ | 
					
						
							| 
									
										
										
										
											2024-02-28 18:07:22 +00:00
										 |  |  |     pip3 install --break-system-packages --no-cache-dir -r requirements.txt && \ | 
					
						
							|  |  |  |     pip3 install --break-system-packages --no-cache-dir . && \ | 
					
						
							| 
									
										
										
										
											2019-10-16 14:46:58 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2018-03-25 18:35:32 +00:00
										 |  |  | # Setup user, groups and configs | 
					
						
							|  |  |  |     addgroup -g 2000 heralding && \ | 
					
						
							| 
									
										
										
										
											2018-05-07 20:25:00 +00:00
										 |  |  |     adduser -S -H -s /bin/ash -u 2000 -D -g 2000 heralding && \ | 
					
						
							| 
									
										
										
										
											2018-03-31 21:44:11 +00:00
										 |  |  |     mkdir -p /var/log/heralding/ /etc/heralding && \ | 
					
						
							|  |  |  |     mv /root/dist/heralding.yml /etc/heralding/ && \ | 
					
						
							| 
									
										
										
										
											2024-02-28 18:07:22 +00:00
										 |  |  |     setcap cap_net_bind_service=+ep $(readlink -f $(type -P python3)) && \ | 
					
						
							| 
									
										
										
										
											2018-05-07 20:25:00 +00:00
										 |  |  |     chown -R heralding:heralding /var/log/heralding && \ | 
					
						
							| 
									
										
										
										
											2019-10-16 14:46:58 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2018-03-25 18:35:32 +00:00
										 |  |  | # Clean up | 
					
						
							| 
									
										
										
										
											2018-03-25 20:58:46 +00:00
										 |  |  |     apk del --purge \ | 
					
						
							| 
									
										
										
										
											2024-02-28 18:07:22 +00:00
										 |  |  | 		build-base \ | 
					
						
							|  |  |  | 		git \ | 
					
						
							|  |  |  | 		libcap \ | 
					
						
							|  |  |  | 		libffi-dev \ | 
					
						
							|  |  |  | 		openssl-dev \ | 
					
						
							|  |  |  | 		postgresql-dev \ | 
					
						
							|  |  |  | 		python3-dev && \ | 
					
						
							| 
									
										
										
										
											2018-05-07 20:25:00 +00:00
										 |  |  |     rm -rf /root/* \ | 
					
						
							| 
									
										
										
										
											2024-02-28 18:07:22 +00:00
										 |  |  | 		/var/cache/apk/* \ | 
					
						
							|  |  |  | 		/opt/heralding | 
					
						
							| 
									
										
										
										
											2019-10-16 14:46:58 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2020-01-02 17:37:08 +00:00
										 |  |  | # Start Heralding | 
					
						
							| 
									
										
										
										
											2018-09-11 12:19:26 +00:00
										 |  |  | STOPSIGNAL SIGINT | 
					
						
							| 
									
										
										
										
											2018-03-31 21:44:11 +00:00
										 |  |  | WORKDIR /tmp/heralding/ | 
					
						
							| 
									
										
										
										
											2018-05-07 20:25:00 +00:00
										 |  |  | USER heralding:heralding | 
					
						
							| 
									
										
										
										
											2018-04-17 13:54:57 +00:00
										 |  |  | CMD exec heralding -c /etc/heralding/heralding.yml -l /var/log/heralding/heralding.log |