File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- FROM opendronemap/odm:latest
2- MAINTAINER Piero Toffanin <pt@masseranolabs.com>
3-
4- EXPOSE 3000
5-
6- USER root
7- RUN apt-get update && apt-get install -y curl gpg-agent
8- RUN curl --silent --location https://deb.nodesource.com/setup_14.x | bash -
9- RUN apt-get install -y nodejs unzip p7zip-full && npm install -g nodemon && \
10- ln -s /code/SuperBuild/install/bin/untwine /usr/bin/untwine && \
11- ln -s /code/SuperBuild/install/bin/entwine /usr/bin/entwine && \
12- ln -s /code/SuperBuild/install/bin/pdal /usr/bin/pdal
13-
14-
15- RUN mkdir /var/www
16-
17- WORKDIR "/var/www"
18- COPY . /var/www
19-
20- RUN npm install --production && mkdir -p tmp
21-
22- ENTRYPOINT ["/usr/bin/node" , "/var/www/index.js" ]
1+ FROM opendronemap/odm:latest
2+ MAINTAINER Piero Toffanin <pt@masseranolabs.com>
3+
4+ EXPOSE 3000
5+
6+ USER root
7+
8+ RUN mkdir /var/www
9+
10+ WORKDIR "/var/www"
11+ COPY . /var/www
12+
13+ ENV NVM_DIR /usr/local/nvm
14+ ENV NODE_VERSION 14
15+
16+ RUN bash install_deps.sh && \
17+ ln -s /code/SuperBuild/install/bin/untwine /usr/bin/untwine && \
18+ ln -s /code/SuperBuild/install/bin/entwine /usr/bin/entwine && \
19+ ln -s /code/SuperBuild/install/bin/pdal /usr/bin/pdal && \
20+ ln -s /var/www/node.sh /usr/bin/node && \
21+ mkdir -p tmp && node index.js --powercycle
22+
23+ ENTRYPOINT ["/usr/bin/node" , "/var/www/index.js" ]
Original file line number Diff line number Diff line change @@ -4,12 +4,15 @@ MAINTAINER Piero Toffanin <pt@masseranolabs.com>
44EXPOSE 3000
55
66USER root
7- RUN apt-get update && apt-get install -y curl gpg-agent ca-certificates
8- RUN curl --silent --location https://deb.nodesource.com/setup_14.x | bash -
9- RUN apt-get install -y nodejs unzip p7zip-full && npm install -g nodemon && \
7+
8+ ENV NVM_DIR /usr/local/nvm
9+ ENV NODE_VERSION 14
10+
11+ RUN bash install_deps.sh && \
1012 ln -s /code/SuperBuild/install/bin/untwine /usr/bin/untwine && \
1113 ln -s /code/SuperBuild/install/bin/entwine /usr/bin/entwine && \
12- ln -s /code/SuperBuild/install/bin/pdal /usr/bin/pdal
14+ ln -s /code/SuperBuild/install/bin/pdal /usr/bin/pdal && \
15+ ln -s /var/www/node.sh /usr/bin/node
1316
1417RUN echo /usr/local/cuda-11.2/compat >> /etc/ld.so.conf.d/989_cuda-11.conf && ldconfig
1518
@@ -19,7 +22,7 @@ WORKDIR "/var/www"
1922RUN useradd -m -d "/home/odm" -s /bin/bash odm
2023COPY --chown=odm:odm . /var/www
2124
22- RUN npm install --production && mkdir -p tmp
25+ RUN npm install --production && mkdir -p tmp && node index.js --powercycle
2326
2427RUN chown -R odm:odm /var/www
2528RUN chown -R odm:odm /code
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ if [ -z " $NVM_DIR " ]; then
4+ echo " Error: NVM_DIR environment variable is not set" >&2
5+ exit 1
6+ fi
7+ if [ -z " $NODE_VERSION " ]; then
8+ echo " Error: NODE_VERSION environment variable is not set" >&2
9+ exit 1
10+ fi
11+
312for i in {1..20}; do
413 apt-get update && apt-get install -y curl gpg-agent && break
514 echo " apt-get failed, retrying... ($i /20)"
615 sleep 30
716done
817
9- curl --silent --location https://deb.nodesource.com/setup_14.x | bash -
18+ mkdir -p $NVM_DIR
19+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
20+ source $NVM_DIR /nvm.sh
21+ nvm install $NODE_VERSION
22+ nvm alias default $NODE_VERSION
1023
1124for i in {1..20}; do
12- apt-get install -y nodejs npm unzip p7zip-full && npm install -g nodemon && break
25+ apt-get install -y unzip p7zip-full && npm install -g nodemon && break
1326 echo " apt-get failed, retrying... ($i /20)"
1427 sleep 30
15- done
28+ done
29+
30+ npm install --production
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ if [ -z " $NVM_DIR " ]; then
4+ echo " Error: NVM_DIR environment variable is not set" >&2
5+ exit 1
6+ fi
7+
8+ source $NVM_DIR /nvm.sh
9+ nvm use $NODE_VERSION
10+ exec node " $@ "
You can’t perform that action at this time.
0 commit comments