| 
									
										
										
										
											2024-12-05 18:32:20 +00:00
										 |  |  | FROM alpine:3.20 | 
					
						
							| 
									
										
										
										
											2019-08-16 14:43:10 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2018-05-26 23:09:31 +00:00
										 |  |  | # Install packages | 
					
						
							| 
									
										
										
										
											2024-12-05 18:32:20 +00:00
										 |  |  | RUN apk --no-cache -U upgrade && \ | 
					
						
							|  |  |  |     apk --no-cache -U add \ | 
					
						
							| 
									
										
										
										
											2024-03-11 16:33:53 +00:00
										 |  |  | 		build-base \ | 
					
						
							|  |  |  | 		file \ | 
					
						
							|  |  |  | 		git \ | 
					
						
							|  |  |  | 		make \ | 
					
						
							|  |  |  | 		php83 \ | 
					
						
							|  |  |  | 		php83-dev \ | 
					
						
							|  |  |  | 		py3-aiohttp \ | 
					
						
							|  |  |  | 		python3 \ | 
					
						
							|  |  |  | 		python3-dev \ | 
					
						
							|  |  |  | 		re2c && \ | 
					
						
							| 
									
										
										
										
											2019-08-16 14:43:10 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2018-05-26 23:09:31 +00:00
										 |  |  | # Install bfr sandbox from git | 
					
						
							| 
									
										
										
										
											2024-03-11 16:33:53 +00:00
										 |  |  |     git clone https://github.com/mushorg/BFR -b v1.0.0 /opt/BFR && \ | 
					
						
							| 
									
										
										
										
											2018-05-26 23:09:31 +00:00
										 |  |  |     cd /opt/BFR && \ | 
					
						
							| 
									
										
										
										
											2024-03-11 16:33:53 +00:00
										 |  |  |     phpize83 && \ | 
					
						
							| 
									
										
										
										
											2018-05-26 23:09:31 +00:00
										 |  |  |     ./configure \ | 
					
						
							| 
									
										
										
										
											2024-03-11 16:33:53 +00:00
										 |  |  |       --with-php-config=/usr/bin/php-config83 \ | 
					
						
							| 
									
										
										
										
											2018-05-26 23:09:31 +00:00
										 |  |  |       --enable-bfr && \ | 
					
						
							|  |  |  |     make && \ | 
					
						
							|  |  |  |     make install && \ | 
					
						
							|  |  |  |     cd / && \ | 
					
						
							|  |  |  |     rm -rf /opt/BFR /tmp/* /var/tmp/* && \ | 
					
						
							| 
									
										
										
										
											2024-03-11 16:33:53 +00:00
										 |  |  |     echo "zend_extension = "$(find /usr -name bfr.so) >> /etc/php83/php.ini && \ | 
					
						
							| 
									
										
										
										
											2019-08-16 14:43:10 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2018-05-26 23:09:31 +00:00
										 |  |  | # Install PHP Sandbox | 
					
						
							| 
									
										
										
										
											2020-09-04 12:37:28 +00:00
										 |  |  |     git clone https://github.com/mushorg/phpox /opt/phpox && \ | 
					
						
							| 
									
										
										
										
											2018-05-26 23:09:31 +00:00
										 |  |  |     cd /opt/phpox && \ | 
					
						
							| 
									
										
										
										
											2024-12-05 18:32:20 +00:00
										 |  |  |     git checkout 55a6cbdc2c62f08eb45acffaf84f23f06a1d4703 && \ | 
					
						
							| 
									
										
										
										
											2018-05-26 23:09:31 +00:00
										 |  |  |     make && \ | 
					
						
							| 
									
										
										
										
											2019-08-16 14:43:10 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2018-05-26 23:09:31 +00:00
										 |  |  | # Clean up | 
					
						
							|  |  |  |     apk del --purge build-base \ | 
					
						
							|  |  |  |                     git \ | 
					
						
							| 
									
										
										
										
											2024-03-11 16:33:53 +00:00
										 |  |  |                     php83-dev \ | 
					
						
							| 
									
										
										
										
											2018-05-26 23:09:31 +00:00
										 |  |  |                     python3-dev && \ | 
					
						
							| 
									
										
										
										
											2022-03-08 23:36:03 +00:00
										 |  |  |     rm -rf /root/* /var/cache/apk/* /opt/phpox/.git | 
					
						
							| 
									
										
										
										
											2019-08-16 14:43:10 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2018-05-26 23:09:31 +00:00
										 |  |  | # Set workdir and start phpsandbox | 
					
						
							| 
									
										
										
										
											2018-09-11 12:19:26 +00:00
										 |  |  | STOPSIGNAL SIGKILL | 
					
						
							| 
									
										
										
										
											2018-05-28 16:36:02 +00:00
										 |  |  | USER nobody:nobody | 
					
						
							| 
									
										
										
										
											2018-05-26 23:09:31 +00:00
										 |  |  | WORKDIR /opt/phpox | 
					
						
							| 
									
										
										
										
											2019-08-16 16:55:36 +00:00
										 |  |  | CMD ["python3", "sandbox.py"] |