Skip to content

jgauthi/poc_docker_nginx_php_mysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Nginx + PHP + Mysql + Dev Tools

A Docker image based on Ubuntu, serving PHP 8.2 FPM running as Nginx Module. Useful for Web developers in need for a fixed PHP version. In addition, the error_reporting setting in php.ini is configurable per container via environment variable.

Prerequisite

Installation

Before use the docker version, check that ports 80/8080/443 are available. If an Apache / Nginx local server, another docker container are active, they can block access to these ports.

# [Optional] Before launch install, you can edit the docker .env
make conf-env-file
# edit .env

make install

# If symfony project is present on project folder
make install composer-install perm

Installed packages:

  • nginx
  • php
  • php-cli
  • php-acpu
  • php-curl
  • php-gd
  • php-imagick
  • php-intl
  • php-mbstring
  • php-pdo_mysql
  • php-opcache
  • php-zip
  • composer (php package manager)

For test Nginx/php container, you can install Symfony Demo

make install-demo

Usage

Launch docker containers: make up, or stop with make stop, you can get command list with make help.

You can connect on url application:

Dev environment

If you use dev docker file (default configuration), you have additional tools:

  • You can access to mysql on localhost:33060 (for PhpStorm / Mysql Workbench).
  • You can use mysql command line without indicate user/pass:
    • Standard request: make db-query CMD="show tables;"
    • Dump: make db-dump

Enjoy