# syntax=docker/dockerfile:1

FROM ubuntu/apache2:2.4-24.04_beta

RUN apt-get update && apt-get install -y software-properties-common
RUN add-apt-repository ppa:ondrej/php
RUN apt update
RUN apt upgrade -y
RUN apt install -y php7.4 nano libapache2-mod-php7.4 sudo apache2-utils git wget openssh-server
RUN a2enmod rewrite
RUN echo 'root:AAAaaa111' | chpasswd

WORKDIR /var/www/html
COPY . .

RUN mv -f /var/www/html/000-default.conf /etc/apache2/sites-available/
RUN usermod -aG sudo www-data
RUN chmod 755 /var/www/html/Scripts/*.sh

RUN echo "Defaults:www-data !requiretty" >> /etc/sudoers
RUN echo "www-data        ALL=(ALL)       NOPASSWD:/var/www/html/Scripts/" >> /etc/sudoers

EXPOSE 22