This repository has been archived by the owner on Sep 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
51 lines (39 loc) · 1.9 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 kartoza/postgis:10.0-2.4
ENV PATH /opt/conda/bin:$PATH
RUN apt-get update --fix-missing && apt-get install -y wget bzip2 ca-certificates \
libglib2.0-0 libxext6 libsm6 libxrender1 postgresql-10-postgis-2.4 postgis git unzip
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate base" >> ~/.bashrc
RUN apt-get install -y curl grep sed dpkg postgresql-plpython3-10 unzip python3-pip sudo && \
TINI_VERSION=`curl https://github.com/krallin/tini/releases/latest | grep -o "/v.*\"" | sed 's:^..\(.*\).$:\1:'` && \
curl -L "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini_${TINI_VERSION}.deb" > tini.deb && \
dpkg -i tini.deb && \
rm tini.deb && \
apt-get clean
RUN conda install -c conda-forge python
#RUN conda config --remove channels 'defaults'
RUN conda install -c conda-forge jupyterlab ncurses pyproj beautifulsoup4 shapely psycopg2 matplotlib basemap
RUN conda install --channel conda-forge gdal
# check that key packages are importable
RUN python -c 'from osgeo import gdal'
# conda's networkx cannot be accessed, stuck with debian's python for plpython (set at compile time)
# apt has older version of networkx, cannot be used.
# so i have to use pip3
RUN pip3 install numpy scipy networkx
EXPOSE 8888
COPY create_plpython3u.sql /docker-entrypoint-initdb.d/
# default database settings
ENV POSTGRES_USER=finn \
POSTGRES_PASS=finn \
POSTGRES_DBNAME=finn \
PGDATABASE=finn \
PGUSER=finn \
PGPASSWORD=finn \
PGHOST=localhost \
PGPORT=5432
RUN echo "psql -d finn -c 'CREATE LANGUAGE plpython3u;'" >> /docker-entrypoint.sh
ENTRYPOINT /docker-entrypoint.sh