forked from OpenDroneMap/WebODM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (37 loc) · 2.04 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM ubuntu:18.04
MAINTAINER Piero Toffanin <[email protected]>
ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH $PYTHONPATH:/webodm
ENV PROJ_LIB=/usr/share/proj
# Prepare directory
RUN mkdir /webodm
WORKDIR /webodm
RUN apt-get -qq update && apt-get install -y software-properties-common tzdata
RUN add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
# Install Node.js
RUN apt-get -qq update && apt-get -qq install -y --no-install-recommends wget curl
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
# Install Python3, GDAL, nginx, letsencrypt, psql
RUN apt-get -qq update && apt-get -qq install -y --no-install-recommends python3 python3-pip python3-setuptools python3-wheel git g++ python3-dev libpq-dev binutils libproj-dev gdal-bin python3-gdal nginx certbot grass-core gettext-base cron postgresql-client-10
RUN update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 && update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2
RUN ln -s /usr/bin/pip3 /usr/bin/pip && pip install -U pip
# Install pip reqs
ADD requirements.txt /webodm/
RUN pip install -r requirements.txt
ADD . /webodm/
# Setup cron
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
RUN git submodule update --init
WORKDIR /webodm/nodeodm/external/NodeODM
RUN npm install --quiet
WORKDIR /webodm
RUN npm install --quiet -g [email protected] && npm install --quiet -g webpack-cli && npm install --quiet && webpack --mode production
RUN echo "UTC" > /etc/timezone
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
# 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