From 6870eb425a3eb9794d95ee81a86c61de3527a781 Mon Sep 17 00:00:00 2001 From: WilliamMiceli Date: Sat, 23 Nov 2019 00:13:06 -0500 Subject: [PATCH] Learned that services are only running within the Docker build layer they are started in it seems... --- Dockerfile | 7 ------- entrypoint.sh | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3335017..bfbb32a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,10 +13,6 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins && 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/ @@ -34,9 +30,6 @@ COPY /entrypoint.sh / 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"] \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 369ee77..4a0f5ef 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,10 @@ #!/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" nginx -g "daemon off;" # Foreground