Add run script that sets the render group and runs as user odm.

pull/173/head
Branton Davis 2021-10-07 15:28:34 -05:00
rodzic f70f3aa7fa
commit 3ce397c5b8
3 zmienionych plików z 9 dodań i 16 usunięć

Wyświetl plik

@ -29,6 +29,5 @@ RUN usermod -aG video,users odm
RUN usermod -aG video,users,odm root
WORKDIR /var/www
USER odm
ENTRYPOINT ["/usr/bin/node", "/var/www/index.js"]
ENTRYPOINT ["/var/www/run_gpu_intel.sh"]

Wyświetl plik

@ -1,14 +0,0 @@
FROM opendronemap/nodeodm:gpu.intel
EXPOSE 3000
ARG RENDER_GROUP_ID=0
USER root
RUN if [ "${RENDER_GROUP_ID}" -ne 0 ]; then groupadd -g "${RENDER_GROUP_ID}" render; usermod -aG render odm; fi
WORKDIR /var/www
USER odm
ENTRYPOINT ["/usr/bin/node", "/var/www/index.js"]

8
run_gpu_intel.sh 100755
Wyświetl plik

@ -0,0 +1,8 @@
#!/usr/bin/env bash
if [ "${RENDER_GROUP_ID}" -ne 0 ]; then
groupadd -g "${RENDER_GROUP_ID}" render
usermod -aG render odm
fi
su - odm -c "/usr/bin/node /var/www/index.js $@"