Moved starting services to inside dockerfile; side-benefit of faster startups
This commit is contained in:
@@ -13,9 +13,14 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
|
|||||||
&& rm -rf /var/www/html \
|
&& rm -rf /var/www/html \
|
||||||
&& rm /etc/nginx/sites-enabled/default
|
&& rm /etc/nginx/sites-enabled/default
|
||||||
|
|
||||||
|
# Start services
|
||||||
|
RUN service mysql start \
|
||||||
|
&& service php7.2-fpm start
|
||||||
|
|
||||||
# Copying in nginx configuration
|
# Copying in nginx configuration
|
||||||
COPY /etc/ /etc/
|
COPY /etc/ /etc/
|
||||||
|
|
||||||
|
# Copying in scripts and making them executable
|
||||||
COPY /scripts/ /scripts/
|
COPY /scripts/ /scripts/
|
||||||
RUN chmod -R +x /scripts/
|
RUN chmod -R +x /scripts/
|
||||||
|
|
||||||
@@ -25,8 +30,9 @@ RUN /scripts/mysql_setup.sh
|
|||||||
# Copying in startup script
|
# Copying in startup script
|
||||||
COPY /entrypoint.sh /
|
COPY /entrypoint.sh /
|
||||||
|
|
||||||
# Copying in web files
|
# Copying in web files and setting default owenership
|
||||||
COPY /var/www/ /var/www/
|
COPY /var/www/ /var/www/
|
||||||
|
RUN chown -R www-data:www-data /var/www
|
||||||
|
|
||||||
# Setting up the database tables
|
# Setting up the database tables
|
||||||
#RUN mysql -u root friendbook < initialization.sql
|
#RUN mysql -u root friendbook < initialization.sql
|
||||||
|
|||||||
@@ -1,13 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "[ INFO ] Recursively setting www-data:www-data permissions on root web directory"
|
|
||||||
chown -R www-data:www-data /var/www
|
|
||||||
|
|
||||||
echo "[ INFO ] Starting MySQL Server"
|
|
||||||
service mysql start
|
|
||||||
|
|
||||||
echo "[ INFO ] Starting PHP 7.2 Service"
|
|
||||||
service php7.2-fpm start
|
|
||||||
|
|
||||||
echo "[ INFO ] Starting nginx"
|
echo "[ INFO ] Starting nginx"
|
||||||
nginx -g "daemon off;" # Foreground
|
nginx -g "daemon off;" # Foreground
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
service mysql start
|
|
||||||
|
|
||||||
# Perform the equivalent of running `mysql_secure_installation`
|
# Perform the equivalent of running `mysql_secure_installation`
|
||||||
mysql -e "UPDATE mysql.user SET authentication_string=PASSWORD('Password1234') WHERE User='root';"
|
mysql -e "UPDATE mysql.user SET authentication_string=PASSWORD('Password1234') WHERE User='root';"
|
||||||
|
|||||||
Reference in New Issue
Block a user