OpenDroneMap-WebODM/Dockerfile

53 wiersze
2.5 KiB
Docker
Czysty Zwykły widok Historia

2020-07-26 16:24:01 +00:00
FROM debian:stretch
2016-09-11 23:52:31 +00:00
MAINTAINER Piero Toffanin <pt@masseranolabs.com>
ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH $PYTHONPATH:/webodm
ENV PROJ_LIB=/usr/share/proj
2016-09-11 23:52:31 +00:00
# Prepare directory
RUN mkdir /webodm
WORKDIR /webodm
2020-07-27 15:45:31 +00:00
# Install Node.js
2020-07-26 16:24:01 +00:00
RUN apt-get -qq update && apt-get -qq install -y --no-install-recommends wget
RUN wget --no-check-certificate https://deb.nodesource.com/setup_12.x -O /tmp/node.sh && bash /tmp/node.sh
RUN apt-get -qq update && apt-get -qq install -y nodejs
# Configure use of testing branch of Debian
RUN printf "Package: *\nPin: release a=stable\nPin-Priority: 900\n" > /etc/apt/preferences.d/stable.pref
RUN printf "Package: *\nPin: release a=testing\nPin-Priority: 750\n" > /etc/apt/preferences.d/testing.pref
2019-09-13 14:21:13 +00:00
RUN printf "deb http://ftp.us.debian.org/debian/ stable main contrib non-free\ndeb-src http://ftp.us.debian.org/debian/ stable main contrib non-free" > /etc/apt/sources.list.d/stable.list
RUN printf "deb http://ftp.us.debian.org/debian/ testing main contrib non-free\ndeb-src http://ftp.us.debian.org/debian/ testing main contrib non-free" > /etc/apt/sources.list.d/testing.list
2020-07-27 15:45:31 +00:00
# Install Python3, GDAL, nginx, letsencrypt, psql
2020-07-26 16:24:01 +00:00
RUN apt-get -qq update && apt-get -qq install -t testing -y --no-install-recommends python3 python3-pip git g++ python3-dev libpq-dev binutils libproj-dev gdal-bin python3-gdal nginx certbot grass-core && apt-get -qq install -y --no-install-recommends gettext-base cron postgresql-client-9.6
RUN update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 && update-alternatives --install /usr/bin/python python /usr/bin/python3.8 2
2018-02-16 15:45:53 +00:00
2017-11-17 18:42:34 +00:00
# Install pip reqs
ADD requirements.txt /webodm/
RUN pip install -r requirements.txt
ADD . /webodm/
# Setup cron
2019-01-02 21:21:46 +00:00
RUN 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
2017-11-17 18:42:34 +00:00
RUN git submodule update --init
WORKDIR /webodm/nodeodm/external/NodeODM
2018-02-16 15:45:53 +00:00
RUN npm install --quiet
WORKDIR /webodm
RUN npm install --quiet -g webpack && npm install --quiet -g webpack-cli && npm install --quiet && webpack --mode production
RUN python manage.py collectstatic --noinput
RUN bash app/scripts/plugin_cleanup.sh && echo "from app.plugins import build_plugins;build_plugins()" | python manage.py shell
2020-07-26 16:24:01 +00:00
# Cleanup
RUN apt-get remove -y g++ python3-dev libpq-dev && apt-get autoremove -y
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN rm /webodm/webodm/secret_key.py
VOLUME /webodm/app/media