# Use the official Ubuntu base image FROM ubuntu:20.04 # Set environment variables to non-interactive for apt ENV DEBIAN_FRONTEND=noninteractive # Install dependencies RUN apt-get update && apt-get install -y \ git \ curl \ sudo \ wget \ python3 \ python3-pip \ redis-server \ postgresql \ postgresql-contrib \ libpq-dev \ gdal-bin \ && apt-get clean # Install Node.js RUN curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - \ && apt-get install -y nodejs # Clone WebODM repository RUN git clone https://github.com/OpenDroneMap/WebODM --depth 1 /webodm # Set working directory WORKDIR /webodm # Fix permissions for the WebODM directory RUN chmod -R 755 /webodm # Ensure the user and group have the correct permissions RUN groupadd webodmgroup RUN useradd -m -g webodmgroup webodmuser RUN chown -R webodmuser:webodmgroup /webodm # Switch to the new user USER webodmuser # Modify requirements.txt to use compatible versions of numpy and scipy RUN sed -i 's/numpy==1.26.2/numpy==1.24.4/' requirements.txt RUN sed -i 's/scipy==1.11.3/scipy==1.10.1/' requirements.txt # Install Python dependencies RUN pip3 install -r requirements.txt # Install WebODM dependencies without Docker RUN ./webodm.sh install # Expose the default WebODM port EXPOSE 8000 # Create a start script to run necessary services and WebODM RUN echo '#!/bin/bash\n\ sudo service redis-server start\n\ sudo service postgresql start\n\ ./webodm.sh start --force-yes\n\ tail -f /dev/null' > /webodm/start.sh RUN chmod +x /webodm/start.sh # Start services and WebODM CMD ["/webodm/start.sh"]