This is mid test project for System and Network Administration subject
https://github.com/naufaruuu/redlock-web-2.0
<aside> 🗨️ Used to build Docker Image as defined requirements in the exam.
</aside>
FROM ubuntu:22.04
ARG MYSQL_ROOT_PASSWORD=password
ENV DEBIAN_FRONTEND=noninteractive
RUN echo "mysql-server mysql-server/root-pass password '${MYSQL_ROOT_PASSWORD}'" | debconf-set-selections
RUN echo "mysql-server mysql-server/re-root-pass password '${MYSQL_ROOT_PASSWORD}'" | debconf-set-selections
RUN apt-get update \\
&& apt-get install -y apache2 mysql-server netcat supervisor php8.1 php8.1-mysql \\
&& apt-get -y autoremove \\
&& apt-get clean \\
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN sed -i 's/DirectoryIndex index.html/DirectoryIndex index.php/g' /etc/apache2/mods-enabled/dir.conf
RUN sed -i 's/^bind-address/# bind-address/' /etc/mysql/mysql.conf.d/mysqld.cnf
COPY setup.sh /
COPY init.sh /
COPY redlock-db.sql /
COPY db.php /var/www/html/
COPY index.php /var/www/html/
RUN chmod -R u+rwX,g+rX,o-rwx /var/www/html && \\
chown -R www-data:www-data /var/www/html
RUN chmod +x /setup.sh
EXPOSE 3306 80
CMD [ "/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf" ]
FROM ubuntu:22.04
ARG MYSQL_ROOT_PASSWORD=password
ENV DEBIAN_FRONTEND=noninteractive
RUN echo "mysql-server mysql-server/root-pass password '${MYSQL_ROOT_PASSWORD}'" | debconf-set-selections
MYSQL_ROOT_PASSWORD
into the debconf-set-selection
****command, which preconfigures the silent MySQL server installation script to use the specified password without prompting the user for input.RUN echo "mysql-server mysql-server/re-root-pass password '${MYSQL_ROOT_PASSWORD}'" | debconf-set-selections
MYSQL_ROOT_PASSWORD
into the debconf-set-selection
****command, which preconfigures the silent MySQL server installation script to use the specified password without prompting the user for input.RUN apt-get update
apt-get install -y apache2 mysql-server netcat supervisor php8.1 php8.1-mysql
apt-get -y autoremove