| 
									
										
										
										
											2021-06-08 02:30:45 +00:00
										 |  |  | # pip dependencies install stage
 | 
					
						
							| 
									
										
										
										
											2024-02-10 23:09:12 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-20 12:42:17 +00:00
										 |  |  | ARG PYTHON_VERSION=3.11
 | 
					
						
							| 
									
										
										
										
											2024-06-17 07:46:54 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-20 13:07:17 +00:00
										 |  |  | FROM python:${PYTHON_VERSION}-slim-bookworm AS builder
 | 
					
						
							| 
									
										
										
										
											2021-05-25 05:04:33 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-13 11:28:20 +00:00
										 |  |  | # See `cryptography` pin comment in requirements.txt
 | 
					
						
							| 
									
										
										
										
											2021-05-25 05:04:33 +00:00
										 |  |  | ARG CRYPTOGRAPHY_DONT_BUILD_RUST=1 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-08 02:30:45 +00:00
										 |  |  | RUN apt-get update && apt-get install -y --no-install-recommends \
 | 
					
						
							| 
									
										
										
										
											2022-10-09 20:29:18 +00:00
										 |  |  |     g++ \
 | 
					
						
							| 
									
										
										
										
											2021-06-17 13:04:51 +00:00
										 |  |  |     gcc \
 | 
					
						
							|  |  |  |     libc-dev \
 | 
					
						
							| 
									
										
										
										
											2022-10-09 20:29:18 +00:00
										 |  |  |     libffi-dev \
 | 
					
						
							| 
									
										
										
										
											2022-11-20 13:40:41 +00:00
										 |  |  |     libjpeg-dev \
 | 
					
						
							| 
									
										
										
										
											2022-10-09 20:29:18 +00:00
										 |  |  |     libssl-dev \
 | 
					
						
							| 
									
										
										
										
											2021-06-17 13:04:51 +00:00
										 |  |  |     libxslt-dev \
 | 
					
						
							| 
									
										
										
										
											2022-10-09 20:29:18 +00:00
										 |  |  |     make \
 | 
					
						
							|  |  |  |     zlib1g-dev
 | 
					
						
							| 
									
										
										
										
											2021-07-26 04:43:23 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-08 02:30:45 +00:00
										 |  |  | RUN mkdir /install
 | 
					
						
							|  |  |  | WORKDIR /install
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | COPY requirements.txt /requirements.txt
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-06-20 12:42:17 +00:00
										 |  |  | # --extra-index-url https://www.piwheels.org/simple  is for cryptography module to be prebuilt (or rustc etc needs to be installed)
 | 
					
						
							|  |  |  | RUN pip install --extra-index-url https://www.piwheels.org/simple  --target=/dependencies -r /requirements.txt
 | 
					
						
							| 
									
										
										
										
											2021-05-25 05:06:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-02 22:47:44 +00:00
										 |  |  | # Playwright is an alternative to Selenium
 | 
					
						
							|  |  |  | # Excluded this package from requirements.txt to prevent arm/v6 and arm/v7 builds from failing
 | 
					
						
							|  |  |  | # https://github.com/dgtlmoon/changedetection.io/pull/1067 also musl/alpine (not supported)
 | 
					
						
							| 
									
										
										
										
											2024-11-20 08:41:56 +00:00
										 |  |  | RUN pip install --target=/dependencies playwright~=1.48.0 \
 | 
					
						
							| 
									
										
										
										
											2022-11-02 22:47:44 +00:00
										 |  |  |     || echo "WARN: Failed to install Playwright. The application can still run, but the Playwright option will be disabled."
 | 
					
						
							| 
									
										
										
										
											2022-10-12 07:53:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-08 02:30:45 +00:00
										 |  |  | # Final image stage
 | 
					
						
							| 
									
										
										
										
											2024-06-17 07:46:54 +00:00
										 |  |  | FROM python:${PYTHON_VERSION}-slim-bookworm
 | 
					
						
							| 
									
										
										
										
											2024-10-09 06:30:23 +00:00
										 |  |  | LABEL org.opencontainers.image.source="https://github.com/dgtlmoon/changedetection.io"
 | 
					
						
							| 
									
										
										
										
											2021-06-08 02:30:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-17 12:40:46 +00:00
										 |  |  | RUN apt-get update && apt-get install -y --no-install-recommends \
 | 
					
						
							| 
									
										
										
										
											2022-12-19 19:46:02 +00:00
										 |  |  |     libxslt1.1 \
 | 
					
						
							| 
									
										
										
										
											2024-07-12 15:09:42 +00:00
										 |  |  |     # For presenting price amounts correctly in the restock/price detection overview
 | 
					
						
							|  |  |  |     locales \
 | 
					
						
							| 
									
										
										
										
											2022-12-19 16:51:41 +00:00
										 |  |  |     # For pdftohtml
 | 
					
						
							|  |  |  |     poppler-utils \
 | 
					
						
							| 
									
										
										
										
											2022-12-19 19:46:02 +00:00
										 |  |  |     zlib1g \
 | 
					
						
							|  |  |  |     && apt-get clean && rm -rf /var/lib/apt/lists/*
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-17 12:40:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-08 02:30:45 +00:00
										 |  |  | # https://stackoverflow.com/questions/58701233/docker-logs-erroneously-appears-empty-until-container-stops
 | 
					
						
							|  |  |  | ENV PYTHONUNBUFFERED=1 | 
					
						
							| 
									
										
										
										
											2021-01-27 19:51:55 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-21 15:31:42 +00:00
										 |  |  | RUN [ ! -d "/datastore" ] && mkdir /datastore
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-16 11:13:47 +00:00
										 |  |  | # Re #80, sets SECLEVEL=1 in openssl.conf to allow monitoring sites with weak/old cipher suites
 | 
					
						
							|  |  |  | RUN sed -i 's/^CipherString = .*/CipherString = DEFAULT@SECLEVEL=1/' /etc/ssl/openssl.cnf
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-08 02:30:45 +00:00
										 |  |  | # Copy modules over to the final image and add their dir to PYTHONPATH
 | 
					
						
							|  |  |  | COPY --from=builder /dependencies /usr/local
 | 
					
						
							|  |  |  | ENV PYTHONPATH=/usr/local
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-06 20:28:35 +00:00
										 |  |  | EXPOSE 5000
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-01 16:31:09 +00:00
										 |  |  | # The actual flask app module
 | 
					
						
							| 
									
										
										
										
											2021-08-16 13:24:37 +00:00
										 |  |  | COPY changedetectionio /app/changedetectionio
 | 
					
						
							| 
									
										
										
										
											2023-12-01 16:31:09 +00:00
										 |  |  | # Starting wrapper
 | 
					
						
							| 
									
										
										
										
											2021-02-21 15:31:42 +00:00
										 |  |  | COPY changedetection.py /app/changedetection.py
 | 
					
						
							| 
									
										
										
										
											2021-02-21 15:13:55 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-16 08:48:16 +00:00
										 |  |  | # Github Action test purpose(test-only.yml).
 | 
					
						
							|  |  |  | # On production, it is effectively LOGGER_LEVEL=''.
 | 
					
						
							|  |  |  | ARG LOGGER_LEVEL=''
 | 
					
						
							| 
									
										
										
										
											2025-04-12 17:26:17 +00:00
										 |  |  | ENV LOGGER_LEVEL="$LOGGER_LEVEL"
 | 
					
						
							| 
									
										
										
										
											2024-01-16 08:48:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-27 19:51:55 +00:00
										 |  |  | WORKDIR /app
 | 
					
						
							| 
									
										
										
										
											2023-12-01 16:31:09 +00:00
										 |  |  | CMD ["python", "./changedetection.py", "-d", "/datastore"]
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-27 19:51:55 +00:00
										 |  |  | 
 |