FROM ubuntu:24.04

ENV DEBIAN_FRONTEND="noninteractive"
ENV TZ="Europe/London"
ENV DESTDIR=/usr/local/cqrlog

# create the volume folders
RUN mkdir -p /usr/local/cqrlog /cqrlog/build

# update the system
RUN apt-get update

# install lazarus
RUN apt-get install -y \
        git \
        lazarus-ide \
        lcl lcl-gtk2 lcl-qt6 \
        lcl-nogui \
        lcl-units \
        lcl-utils \
        lazarus \
        lazarus-doc \
        lazarus-src \
        fp-units-misc \
        fp-units-rtl \
        fp-utils \
        fpc \
        fpc-source

# Install runtime deps and packing tools
RUN apt-get install -y \
        libssl-dev \
        libfl-dev \
        libqt5pas1 \
        libqt5pas-dev \
        libqt6pas6 \
        libqt6pas-dev \
        qt6-base-dev-tools \
        libfuse2 \
        libsquashfuse0 \
        wget \
        devscripts \
        qt5-qmake-bin \
        qtchooser \
        mariadb-server \
        mariadb-client \
        sudo

# Mount point for the git repository:
# -v $(pwd):/cqrlog
VOLUME ["/cqrlog"]

# Mount point for the result of the build:
# -v /usr/local/cqrlog:/usr/local/cqrlog
VOLUME ["/usr/local/cqrlog"]

# Set the working directory
WORKDIR /cqrlog

CMD ["bash"]
