| 
 | 1 | +FROM ubuntu:20.04  | 
 | 2 | + | 
 | 3 | +# Setup timezone info  | 
 | 4 | +ENV TZ=UTC  | 
 | 5 | + | 
 | 6 | +ENV LC_ALL=C.UTF-8  | 
 | 7 | +ENV LANG=C.UTF-8  | 
 | 8 | + | 
 | 9 | +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone  | 
 | 10 | + | 
 | 11 | +RUN apt-get update && apt-get install -y software-properties-common  | 
 | 12 | + | 
 | 13 | +RUN add-apt-repository ppa:ubuntugis/ppa && \  | 
 | 14 | +    apt-get update && \  | 
 | 15 | +    apt-get install -y build-essential python3-dev python3-pip \  | 
 | 16 | +    jq unzip ca-certificates wget curl git && \  | 
 | 17 | +    apt-get autoremove && apt-get autoclean && apt-get clean  | 
 | 18 | + | 
 | 19 | +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10  | 
 | 20 | + | 
 | 21 | +# See https://github.com/mapbox/rasterio/issues/1289  | 
 | 22 | +ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt  | 
 | 23 | + | 
 | 24 | +# Install Python 3.8  | 
 | 25 | +RUN curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh" \  | 
 | 26 | +    && bash "Mambaforge-$(uname)-$(uname -m).sh" -b -p /opt/conda \  | 
 | 27 | +    && rm -rf "Mambaforge-$(uname)-$(uname -m).sh"  | 
 | 28 | + | 
 | 29 | +ENV PATH /opt/conda/bin:$PATH  | 
 | 30 | +ENV LD_LIBRARY_PATH /opt/conda/lib/:$LD_LIBRARY_PATH  | 
 | 31 | + | 
 | 32 | +RUN mamba install -y -c conda-forge python=3.8 gdal=3.3.3 pip setuptools cython numpy==1.21.5  | 
 | 33 | + | 
 | 34 | +RUN python -m pip install --upgrade pip  | 
 | 35 | + | 
 | 36 | +# Install common packages  | 
 | 37 | +COPY requirements-task-base.txt /tmp/requirements.txt  | 
 | 38 | +RUN python -m pip install --no-build-isolation -r /tmp/requirements.txt  | 
 | 39 | + | 
 | 40 | +#  | 
 | 41 | +# Copy and install packages  | 
 | 42 | +#  | 
 | 43 | + | 
 | 44 | +COPY pctasks/core /opt/src/pctasks/core  | 
 | 45 | +RUN cd /opt/src/pctasks/core && \  | 
 | 46 | +    pip install .  | 
 | 47 | + | 
 | 48 | +COPY pctasks/cli /opt/src/pctasks/cli  | 
 | 49 | +RUN cd /opt/src/pctasks/cli && \  | 
 | 50 | +    pip install .  | 
 | 51 | + | 
 | 52 | +COPY pctasks/task /opt/src/pctasks/task  | 
 | 53 | +RUN cd /opt/src/pctasks/task && \  | 
 | 54 | +    pip install .  | 
 | 55 | + | 
 | 56 | +COPY pctasks/client /opt/src/pctasks/client  | 
 | 57 | +RUN cd /opt/src/pctasks/client && \  | 
 | 58 | +    pip install .  | 
 | 59 | + | 
 | 60 | +COPY pctasks/ingest /opt/src/pctasks/ingest  | 
 | 61 | +RUN cd /opt/src/pctasks/ingest && \  | 
 | 62 | +    pip install .  | 
 | 63 | + | 
 | 64 | +COPY pctasks/dataset /opt/src/pctasks/dataset  | 
 | 65 | +RUN cd /opt/src/pctasks/dataset && \  | 
 | 66 | +    pip install .  | 
 | 67 | + | 
 | 68 | +COPY ./datasets/sentinel-5p/requirements.txt /opt/src/datasets/sentinel-5p/requirements.txt  | 
 | 69 | +RUN python3 -m pip install -r /opt/src/datasets/sentinel-5p/requirements.txt  | 
 | 70 | + | 
 | 71 | +# Setup Python Path to allow import of test modules  | 
 | 72 | +ENV PYTHONPATH=/opt/src:$PYTHONPATH  | 
 | 73 | + | 
 | 74 | +WORKDIR /opt/src  | 
0 commit comments