Files
WMU-CS4430-Project/Dockerfile
2019-11-23 00:12:20 -05:00

42 lines
970 B
Docker

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
# Start services
RUN service mysql start \
&& service php7.2-fpm start
# Copying in nginx configuration
COPY /etc/ /etc/
# Copying in scripts and making them executable
COPY /scripts/ /scripts/
RUN chmod -R +x /scripts/
# Setting up MySQL
RUN /scripts/mysql_setup.sh
# Copying in startup script
COPY /entrypoint.sh /
# Copying in web files and setting default owenership
COPY /var/www/ /var/www/
RUN chown -R www-data:www-data /var/www
# Setting up the database tables
#RUN mysql -u root friendbook < initialization.sql
# Expose Insecure Web, MySQL Server
EXPOSE 80
CMD ["/bin/sh", "/entrypoint.sh"]