FROM ubuntu:18.04 USER root WORKDIR /var/www # Installing needed packages RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ mysql-server \ nginx \ php-fpm \ php-mysql \ php-cli \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /var/www/html \ && rm /etc/nginx/sites-enabled/default # Copying in nginx configuration COPY /etc/ /etc/ # Setting up MySQL --Will come back to later, as it's not necessary and not playing very well with automation RUN mysql -u root <<-EOF UPDATE mysql.user SET authentication_string=PASSWORD('Password1234') WHERE User='root'; DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1'); DELETE FROM mysql.user WHERE User=''; DELETE FROM mysql.db WHERE Db='test' OR Db='test_%'; FLUSH PRIVILEGES; EOF # Copying in startup script COPY /entrypoint.sh / # Copying in web files COPY /var/www/ /var/www/ # Setting up the database tables #RUN mysql -u root friendbook < initialization.sql # Expose Insecure Web, MySQL Server EXPOSE 80 3306 CMD ["/bin/sh", "/entrypoint.sh"]