Learned that services are only running within the Docker build layer they are started in it seems...

This commit is contained in:
WilliamMiceli
2019-11-23 00:13:06 -05:00
parent d84df24e08
commit 6870eb425a
2 changed files with 6 additions and 7 deletions

View File

@@ -13,10 +13,6 @@ 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/
@@ -34,9 +30,6 @@ COPY /entrypoint.sh /
COPY /var/www/ /var/www/ COPY /var/www/ /var/www/
RUN chown -R www-data:www-data /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 Insecure Web, MySQL Server
EXPOSE 80 EXPOSE 80
CMD ["/bin/sh", "/entrypoint.sh"] CMD ["/bin/sh", "/entrypoint.sh"]

View File

@@ -1,4 +1,10 @@
#!/bin/sh #!/bin/sh
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