FROM ubuntu:22.04
#ENV LANG C.UTF-8
MAINTAINER Anandh


WORKDIR /var/www/html

ENV DEBIAN_FRONTEND=noninteractive 

RUN apt-get update && apt-get -y install software-properties-common && add-apt-repository ppa:ondrej/php && apt-get update && apt-get install -y apache2 mysql-client && DEBIAN_FRONTEND="noninteractive" && apt-get -y install php8.1 && apt-get install -y libapache2-mod-php8.1 php8.1-curl php8.1-mysql php8.1-mbstring php8.1-xml php8.1-mysqli php8.1-memcached php8.1-xmlrpc php8.1-pgsql php8.1-zip php8.1-gd php8.1-intl && apt-get clean && rm -rf /var/lib/apt/lists/*
#RUN apt-get install php8.0-json
RUN apt-get install php8.1-dom
RUN apt-get update && \
    apt-get install -y net-tools && \
    rm -rf /var/lib/apt/lists/*
RUN rm -rf /var/www/html/index.html
COPY ./app /var/www/html/
RUN chown -R www-data:www-data /var/www/html
RUN chmod -Rf 755 /var/www/html/
RUN set -ex; \
    # Install required system packages
    apt-get update; \
    apt-get install -qy --no-install-recommends \
            ssmtp \
            mailutils \
    ; \
    # Clean aptitude cache and tmp directory
    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*;
#COPY ssmtp.conf /etc/ssmtp/ssmtp.conf
RUN a2enmod rewrite
COPY apache2.conf /etc/apache2/apache2.conf
COPY 000-default.conf /etc/apache2/sites-available/000-default.conf
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf




EXPOSE 80 25 
#CMD ["postfix", "start-fg"]
CMD service apache2 start




CMD ["sh", "-c", "service apache2 start && service apache2 restart && tail -f /dev/null"]



