diff --git a/README.md b/README.md index b045ec4..4216fee 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,17 @@ # nginx-php7.4-mysql8-node-docker-network Fast lightweight Docker network using PHP MySQL Nginx and Node + +git clone https://github.com/chrisdenmark84/nginx-php7.4-mysql8-node-docker-network.git + +move into nginx-stack-demo folder + +Ensure docker desktop has spun up. + +run "docker-compse up -d --build" +wait ... + +create "public" folder within app folder + +create index.php in public folder + +Open localhost:8080 in your browser \ No newline at end of file diff --git a/app/public/index.php b/app/public/index.php new file mode 100644 index 0000000..56f3a29 --- /dev/null +++ b/app/public/index.php @@ -0,0 +1,5 @@ + diff --git a/docker-compose.yml b/docker-compose.yml index b518e0a..7fb3e78 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,21 +15,24 @@ services: - ./app:/var/www/project - ./nginx/default.conf:/etc/nginx/conf.d/default.conf depends_on: - - php74-service + - php8-service - mysql8-service networks: - nginx-php74-mysql8-node # php - php74-service: + php8-service: build: context: . dockerfile: ./php/Dockerfile - container_name: php74-container + container_name: php8-container + extra_hosts: + - "host.docker.internal:host-gateway" ports: - "9000:9000" volumes: - ./app:/var/www/project + - ./php/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini networks: - nginx-php74-mysql8-node diff --git a/nginx/default.conf b/nginx/default.conf index 2889eac..10b8a74 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -23,7 +23,7 @@ server { # Sets the address of a FastCGI server. The address can be specified as a domain name or IP address, and a port # fastcgi_pass php:9000; - fastcgi_pass php74-service:9000; + fastcgi_pass php8-service:9000; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; diff --git a/php/Dockerfile b/php/Dockerfile index 2608bcb..17ee357 100644 --- a/php/Dockerfile +++ b/php/Dockerfile @@ -1,8 +1,9 @@ -FROM php:7.4-fpm +FROM php:8-fpm RUN apt-get update && apt-get install -y zlib1g-dev g++ git libicu-dev zip libzip-dev zip \ && docker-php-ext-install intl opcache pdo pdo_mysql \ && pecl install apcu \ + && pecl install xdebug \ && docker-php-ext-enable apcu \ && docker-php-ext-configure zip \ && docker-php-ext-install zip @@ -12,4 +13,4 @@ WORKDIR /var/www/project RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer RUN curl -sS https://get.symfony.com/cli/installer | bash -RUN mv /root/.symfony/bin/symfony /usr/local/bin/symfony \ No newline at end of file +RUN mv /root/.symfony5/bin/symfony /usr/local/bin/symfony diff --git a/php/xdebug.ini b/php/xdebug.ini new file mode 100644 index 0000000..1527bdc --- /dev/null +++ b/php/xdebug.ini @@ -0,0 +1,5 @@ +[xdebug] +zend_extension=xdebug.so +xdebug.mode=develop,debug +xdebug.discover_client_host=0 +xdebug.client_host=host.docker.internal \ No newline at end of file