-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
57 lines (48 loc) · 1.41 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
FROM osgeo/gdal:ubuntu-small-3.4.1
ENV DEBIAN_FRONTEND=noninteractive \
LC_ALL=C.UTF-8 \
LANG=C.UTF-8
# Apt installation
RUN apt-get update && \
apt-get install -y \
build-essential \
fish \
git \
vim \
nano \
wget \
python3-pip \
# For FC
libgfortran5 \
# For Psycopg2
libpq-dev python-dev \
&& apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/{apt,dpkg,cache,log}
# Environment can be whatever is supported by setup.py
# so, either deployment, test
ARG ENVIRONMENT=deployment
RUN echo "Environment is: $ENVIRONMENT"
# Pip installation
RUN mkdir -p /conf
COPY requirements.txt /conf/
RUN pip install -r /conf/requirements.txt
# Set up a nice workdir and add the live code
ENV APPDIR=/code
RUN mkdir -p $APPDIR
WORKDIR $APPDIR
ADD . $APPDIR
# These ENVIRONMENT flags make this a bit complex, but basically, if we are in dev
# then we want to link the source (with the -e flag) and if we're in prod, we
# want to delete the stuff in the /code folder to keep it simple.
# no-use-pep517 because of this https://github.com/pypa/pip/issues/7953
RUN if [ "$ENVIRONMENT" = "deployment" ] ; then\
pip install . ; \
rm -rf $APPDIR/* ; \
else \
pip install --no-use-pep517 --editable ".[$ENVIRONMENT]" ; \
fi
RUN pip freeze
# Check it works
RUN datacube-alchemist --version
CMD ["datacube-alchemist", "--help"]