-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
executable file
·85 lines (66 loc) · 3.06 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
FROM python:3.9-bullseye
ENV DEBIAN_FRONTEND noninteractive
ENV PY_SAX_PARSER=hs_core.xmlparser
RUN printf "deb http://deb.debian.org/debian/ bullseye main\ndeb http://deb.debian.org/debian/ bullseye-updates main\ndeb http://security.debian.org/debian-security bullseye-security main" > /etc/apt/sources.list
RUN apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
lsb-release \
sudo
RUN sudo mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
RUN echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
COPY docker.list /etc/apt/sources.list.d/
RUN sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7EA0A9C3F273FCD8
RUN sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
# RUN sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
RUN apt-get update && apt-get install -y \
postgresql-14 \
postgresql-client-14
RUN apt-get update && apt-get install -y --fix-missing --no-install-recommends \
apt-utils \
libfuse2 \
binutils \
libproj-dev \
build-essential \
git \
netcdf-bin
# install node
# https://github.com/nodesource/distributions/blob/master/README.md
RUN curl -fsSL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh \
&& chmod +x nodesource_setup.sh \
&& bash nodesource_setup.sh \
&& apt-get install -y nodejs
RUN npm install -g phantomjs-prebuilt
RUN apt-get update && apt-get install -y --fix-missing --no-install-recommends gdal-bin \
libgdal-dev \
python3-gdal
WORKDIR /
# Install pip based packages (due to dependencies some packages need to come first)
RUN pip install --upgrade pip
RUN pip install 'setuptools<58.0.0'
RUN pip install setuptools-scm==5.0.2
RUN pip install numpy==1.26.4
COPY ./requirements.txt /requirements.txt
RUN pip install -r requirements.txt
# Install pandas late -- incompatibility between pandas and python-dateutil versions
RUN pip install pandas==2.2.2
# install gdal python bindings
RUN pip install gdal[numpy]=="$(gdal-config --version).*"
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
# Explicitly set user/group IDs for hydroshare service account
RUN groupadd --system storage-hydro --gid=10000 \
&& useradd --system -g storage-hydro --uid=10000 --shell /bin/bash --home /hydroshare hydro-service
RUN echo 'hydro-service:docker' | chpasswd
ENV DEBIAN_FRONTEND teletype
# set UTF-8 env locale
RUN echo UTF-8/en_US.UTF-8 UTF-8 > /etc/local.gen; locale-gen
# Cleanup
RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*