FROM php:7.3-apache

RUN apt-get update -qq && \
    apt-get install -qy \
    # Common
    wget \
    nano \
    vim

# DEV
# TODO : https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/laravel + https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/vscode
RUN apt-get install -qy git zsh && sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
## DEV

RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

#RUN useradd -ms /bin/bash noroot

ARG SIMPLESAMLPHP_VERSION=1.19.5
RUN wget https://github.com/simplesamlphp/simplesamlphp/releases/download/v$SIMPLESAMLPHP_VERSION/simplesamlphp-$SIMPLESAMLPHP_VERSION.tar.gz \
    && tar zxf simplesamlphp-$SIMPLESAMLPHP_VERSION.tar.gz \
    && cp -a simplesamlphp-$SIMPLESAMLPHP_VERSION/. /var/simplesamlphp/ \
    && mkdir /var/simplesamlphp/logs

COPY vhost.conf /etc/apache2/sites-available/000-default.conf

RUN a2enmod rewrite remoteip headers

#USER noroot
WORKDIR /var/simplesamlphp/www/