Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amend symfony path in Dockerfie #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions app/public/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

echo "Hello Pete!";

?>
9 changes: 6 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 3 additions & 2 deletions php/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
RUN mv /root/.symfony5/bin/symfony /usr/local/bin/symfony
5 changes: 5 additions & 0 deletions php/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[xdebug]
zend_extension=xdebug.so
xdebug.mode=develop,debug
xdebug.discover_client_host=0
xdebug.client_host=host.docker.internal