Skip to content

Commit

Permalink
Dockerfile changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Jul 26, 2020
1 parent 0e0c558 commit 68ce828
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions Dockerfile
@@ -1,4 +1,4 @@
FROM python:3.8-stretch
FROM debian:stretch
MAINTAINER Piero Toffanin <pt@masseranolabs.com>

ENV PYTHONUNBUFFERED 1
Expand All @@ -9,17 +9,19 @@ ENV PROJ_LIB=/usr/share/proj
RUN mkdir /webodm
WORKDIR /webodm

RUN curl --silent --location https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get -qq install -y nodejs
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
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

# Install Node.js GDAL, nginx, letsencrypt, psql
RUN apt-get -qq update && apt-get -qq install -t testing -y binutils libproj-dev gdal-bin python3-gdal nginx certbot grass-core && apt-get -qq install -y gettext-base cron postgresql-client-9.6
# Install Python3, Node.js GDAL, nginx, letsencrypt, psql
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

# Install pip reqs
ADD requirements.txt /webodm/
Expand All @@ -40,6 +42,10 @@ RUN npm install --quiet -g webpack && npm install --quiet -g webpack-cli && npm
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
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -56,7 +56,7 @@ webcolors==1.5
-e git://github.com/OpenDroneMap/rio-tiler.git#egg=rio-tiler
rio-color==1.0.0
rio-cogeo==1.1.8
rasterio==1.1.0 ; sys_platform == 'linux' or sys_platform == 'darwin'
rasterio==1.1.5 ; sys_platform == 'linux' or sys_platform == 'darwin'
https://download.lfd.uci.edu/pythonlibs/s2jqpv5t/rasterio-1.1.3-cp37-cp37m-win_amd64.whl ; sys_platform == "win32"
https://download.lfd.uci.edu/pythonlibs/s2jqpv5t/GDAL-3.0.4-cp37-cp37m-win_amd64.whl ; sys_platform == "win32"
Shapely==1.7.0 ; sys_platform == "win32"
Expand Down

0 comments on commit 68ce828

Please sign in to comment.