diff --git a/Dockerfile.gpu b/Dockerfile.gpu index fbcd05d..1bff134 100644 --- a/Dockerfile.gpu +++ b/Dockerfile.gpu @@ -5,7 +5,7 @@ EXPOSE 3000 USER root RUN apt-get update && apt-get install -y curl gpg-agent ca-certificates -RUN curl --silent --location https://deb.nodesource.com/setup_10.x | bash - +RUN curl --silent --location https://deb.nodesource.com/setup_14.x | bash - RUN apt-get install -y nodejs unzip p7zip-full && npm install -g nodemon && \ ln -s /code/SuperBuild/install/bin/untwine /usr/bin/untwine && \ ln -s /code/SuperBuild/install/bin/entwine /usr/bin/entwine && \ @@ -18,7 +18,7 @@ WORKDIR "/var/www" RUN useradd -m -d "/home/odm" -s /bin/bash odm COPY --chown=odm:odm . /var/www -RUN npm install && mkdir -p tmp +RUN npm install --production && mkdir -p tmp RUN chown -R odm:odm /var/www RUN chown -R odm:odm /code diff --git a/contrib/README.md b/contrib/README.md new file mode 100644 index 0000000..4268cd6 --- /dev/null +++ b/contrib/README.md @@ -0,0 +1,12 @@ +# Run NodeODM thorugh docker-compose +To easily manage NodeODM with docker-compose take a look at these sample `docker-compose.yml` files + +## Quickstart +Edit the `config-default.json` to match your required settings. Make sure you change the value for `token` to secure +your NodeODM instance if you plan on hosting the server publicly + +## GPU acceleration +To utilize the GPU acceleration of NVIDA graphics cards run: `docker-compose -f docker-compose.gpu.yml up -d` + +## CPU only operation +If there is no GPU acceleration available you can run NodeODM on CPU only with: `docker-compose -f docker-compose.cpu.yml up -d` diff --git a/contrib/config-default.json b/contrib/config-default.json new file mode 100644 index 0000000..51b5b03 --- /dev/null +++ b/contrib/config-default.json @@ -0,0 +1,22 @@ +{ + "instance": "YOUR-INSTANCENAME", + "odm_path": "/code", + + "logger": { + "level": "error", + "maxFileSize": 104857600, + "maxFiles": 10, + "logDirectory": "" + }, + + "port": "3000", + "deamon": false, + "parallelQueueProcessing": 1, + "cleanupTasksAfter": 2880, + "test": false, + "testSkipOrthophotos": false, + "testSkipDems": false, + "token": "CHANGE-THIS-TOKEN-TO-YOUR-OWN-SECRET", + "authorizedIps": [], + "maxImages": "" +} diff --git a/contrib/docker-compose.cpu.yml b/contrib/docker-compose.cpu.yml new file mode 100644 index 0000000..f04e4ef --- /dev/null +++ b/contrib/docker-compose.cpu.yml @@ -0,0 +1,9 @@ +version: '3.8' +services: + node-odm: + image: opendronemap/nodeodm + ports: + - "3000:3000" + volumes: + - ./config-default.json:/var/www/config-default.json + restart: unless-stopped diff --git a/contrib/docker-compose.gpu.yml b/contrib/docker-compose.gpu.yml new file mode 100644 index 0000000..1c68414 --- /dev/null +++ b/contrib/docker-compose.gpu.yml @@ -0,0 +1,16 @@ +version: '3.8' +services: + node-odm: + image: opendronemap/nodeodm:gpu + ports: + - "3000:3000" + volumes: + - ./config-default.json:/var/www/config-default.json + privileged: true + restart: unless-stopped + deploy: + resources: + reservations: + devices: + - driver: nvidia + capabilities: [gpu]