# Copyright (C) 2022 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: GPL-3.0-or-later

# base
FROM ubuntu:22.04
RUN export DEBIAN_FRONTEND="noninteractive" && \
	apt-get update && \
	apt-get upgrade -y && \
	apt-get -y install \
		casacore-dev \
		clang-format-14 \
		doxygen \
		g++ \
		gcovr \
		git \
		graphviz \
		libblas-dev \
		libboost-all-dev \
		libcfitsio-dev \
		libfftw3-dev \
		libgtkmm-3.0-dev \
		libhdf5-dev \
		liblapack-dev \
		libpng-dev \
		libpython3-dev \
		libxml2-dev \
		make \
		ninja-build \
		python3-casacore \
		python3-pip \
		wcslib-dev \
		wget \
	&& \
	rm -rf /var/lib/apt/lists/*
# pytest-lazy-fixture does not work with pytest-8.x -> Use pytest-7.x for now.
# TODO(AST-1501): Investigate removing pytest-lazy-fixture.
RUN pip3 install \
		aptly-api-client \
		astropy \
		black~=24.0 \
		breathe \
		cmake \
		cmake-format \
		h5py \
		lofarantpos \
		matplotlib \
		myst-parser \
		numpy \
		pandas \
		pytest~=7.0 \
		pytest-lazy-fixture \
		scipy \
		sphinx \
		sphinx_rtd_theme \
		tqdm \
	;
# Putting the 2.5 GB LOBES coefficients in the docker image avoids downloading
# them in the jobs that use this image.
RUN mkdir -p /coeffs/lobes && \
  wget -P /coeffs/lobes -r -nH -nd --no-parent -A 'LOBES_*.h5' https://support.astron.nl/software/lobes/
