| 
									
										
										
										
											2022-07-24 17:12:22 +00:00
										 |  |  | FROM ubuntu:21.04
 | 
					
						
							| 
									
										
										
										
											2016-09-11 23:52:31 +00:00
										 |  |  | MAINTAINER Piero Toffanin <pt@masseranolabs.com>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-26 17:44:17 +00:00
										 |  |  | ARG TEST_BUILD
 | 
					
						
							| 
									
										
										
										
											2023-11-19 23:37:01 +00:00
										 |  |  | ARG DEBIAN_FRONTEND=noninteractive | 
					
						
							| 
									
										
										
										
											2016-09-11 23:52:31 +00:00
										 |  |  | ENV PYTHONUNBUFFERED 1
 | 
					
						
							|  |  |  | ENV PYTHONPATH $PYTHONPATH:/webodm
 | 
					
						
							| 
									
										
										
										
											2019-12-09 22:11:57 +00:00
										 |  |  | ENV PROJ_LIB=/usr/share/proj
 | 
					
						
							| 
									
										
										
										
											2016-09-11 23:52:31 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Prepare directory
 | 
					
						
							| 
									
										
										
										
											2017-11-17 18:42:34 +00:00
										 |  |  | ADD . /webodm/
 | 
					
						
							| 
									
										
										
										
											2016-09-27 14:45:09 +00:00
										 |  |  | WORKDIR /webodm
 | 
					
						
							| 
									
										
										
										
											2020-07-26 16:24:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-24 17:12:22 +00:00
										 |  |  | # Use old-releases for 21.04
 | 
					
						
							|  |  |  | RUN printf "deb http://old-releases.ubuntu.com/ubuntu/ hirsute main restricted\ndeb http://old-releases.ubuntu.com/ubuntu/ hirsute-updates main restricted\ndeb http://old-releases.ubuntu.com/ubuntu/ hirsute universe\ndeb http://old-releases.ubuntu.com/ubuntu/ hirsute-updates universe\ndeb http://old-releases.ubuntu.com/ubuntu/ hirsute multiverse\ndeb http://old-releases.ubuntu.com/ubuntu/ hirsute-updates multiverse\ndeb http://old-releases.ubuntu.com/ubuntu/ hirsute-backports main restricted universe multiverse" > /etc/apt/sources.list
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-19 23:37:01 +00:00
										 |  |  | # Install Node.js using new Node install method
 | 
					
						
							| 
									
										
										
										
											2024-05-31 18:43:44 +00:00
										 |  |  | RUN apt-get -qq update && apt-get -o Acquire::Retries=3 -qq install -y --no-install-recommends wget curl && \
 | 
					
						
							|  |  |  |     apt-get -o Acquire::Retries=3 install -y ca-certificates gnupg && \
 | 
					
						
							| 
									
										
										
										
											2023-11-19 23:37:01 +00:00
										 |  |  |     mkdir -p /etc/apt/keyrings && \
 | 
					
						
							|  |  |  |     curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
 | 
					
						
							| 
									
										
										
										
											2023-11-23 01:54:42 +00:00
										 |  |  |     NODE_MAJOR=20 && \
 | 
					
						
							| 
									
										
										
										
											2023-11-19 23:37:01 +00:00
										 |  |  |     echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
 | 
					
						
							| 
									
										
										
										
											2024-05-31 18:43:44 +00:00
										 |  |  |     apt-get -o Acquire::Retries=3 -qq update && apt-get -o Acquire::Retries=3 -qq install -y nodejs && \
 | 
					
						
							| 
									
										
										
										
											2021-11-04 17:27:36 +00:00
										 |  |  |     # Install Python3, GDAL, PDAL, nginx, letsencrypt, psql
 | 
					
						
							| 
									
										
										
										
											2024-05-31 18:43:44 +00:00
										 |  |  |     apt-get -o Acquire::Retries=3 -qq update && apt-get -o Acquire::Retries=3 -qq install -y --no-install-recommends python3 python3-pip python3-setuptools python3-wheel git g++ python3-dev python2.7-dev libpq-dev binutils libproj-dev gdal-bin pdal libgdal-dev python3-gdal nginx certbot gettext-base cron postgresql-client-13 gettext tzdata && \
 | 
					
						
							| 
									
										
										
										
											2021-09-02 18:47:09 +00:00
										 |  |  |     update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 && update-alternatives --install /usr/bin/python python /usr/bin/python3.9 2 && \
 | 
					
						
							|  |  |  |     # Install pip reqs
 | 
					
						
							| 
									
										
										
										
											2024-06-25 18:35:13 +00:00
										 |  |  |     pip install pip==24.0 && pip install -r requirements.txt "boto3==1.14.14" && \
 | 
					
						
							| 
									
										
										
										
											2021-09-02 18:47:09 +00:00
										 |  |  |     # Setup cron
 | 
					
						
							|  |  |  |     ln -s /webodm/nginx/crontab /var/spool/cron/crontabs/root && chmod 0644 /webodm/nginx/crontab && service cron start && chmod +x /webodm/nginx/letsencrypt-autogen.sh && \
 | 
					
						
							| 
									
										
										
										
											2021-09-26 17:44:17 +00:00
										 |  |  |     /webodm/nodeodm/setup.sh && /webodm/nodeodm/cleanup.sh && cd /webodm && \
 | 
					
						
							| 
									
										
										
										
											2023-11-20 23:22:00 +00:00
										 |  |  |     npm install --quiet -g webpack@5.89.0 && npm install --quiet -g webpack-cli@5.1.4 && npm install --quiet && webpack --mode production && \
 | 
					
						
							| 
									
										
										
										
											2021-09-02 18:47:09 +00:00
										 |  |  |     echo "UTC" > /etc/timezone && \
 | 
					
						
							|  |  |  |     python manage.py collectstatic --noinput && \
 | 
					
						
							|  |  |  |     python manage.py rebuildplugins && \
 | 
					
						
							|  |  |  |     python manage.py translate build --safe && \
 | 
					
						
							|  |  |  |     # Cleanup
 | 
					
						
							|  |  |  |     apt-get remove -y g++ python3-dev libpq-dev && apt-get autoremove -y && \
 | 
					
						
							|  |  |  |     apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
 | 
					
						
							|  |  |  |     rm /webodm/webodm/secret_key.py
 | 
					
						
							| 
									
										
										
										
											2017-07-12 13:16:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-08 17:16:02 +00:00
										 |  |  | VOLUME /webodm/app/media
 |