GithubHelp home page GithubHelp logo

iakcay / docker-nginx-php-mysql Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nanoninja/docker-nginx-php-mysql

0.0 0.0 0.0 9 KB

Docker running Nginx, PHP-FPM, MySQL & PHPMyAdmin

Shell 34.52% PHP 65.48%

docker-nginx-php-mysql's Introduction

Nginx PHP MySQL

Docker running Nginx, PHP-FPM, MySQL and PHPMyAdmin.

THIS ENVIRONMENT SHOULD ONLY BE USED FOR DEVELOPMENT!

DO NOT USE IT IN PRODUCTION!

Images to use

Start using it

  1. Download it :

    $ git clone https://github.com/nanoninja/docker-nginx-php-mysql.git
  2. Run :

    $ docker-compose up -d
  3. Open your favorite browser :

Directory tree

├── README.md
├── bin
│   └── linux
│       └── clean.sh
├── data
│   └── db
│       ├── dumps
│       └── mysql
├── docker-compose.yml
├── etc
│   ├── nginx
│   │   └── default.conf
│   ├── php
│   │   └── php.ini
│   └── ssl
└── web
    ├── app
    │   ├── composer.json
    │   ├── phpunit.xml.dist
    │   ├── src
    │   │   └── Foo.php
    │   └── test
    │       ├── FooTest.php
    │       └── bootstrap.php
    └── public
        └── index.php

Connecting from PDO

<?php
    $dsn = 'mysql:host=mysql;dbname=test;charset=utf8;port=3306';
    $pdo = new PDO($dsn, 'dev', 'dev');
?>

Updating composer

$ docker run --rm -v $(pwd)/web/app:/app -v ~/.ssh:/root/.ssh composer/composer update

MySQL Container shell access

$ docker exec -it mysql bash

and

$ mysql -uroot -proot

Creating database dumps

$ docker exec mysql sh -c 'exec mysqldump --all-databases -uroot -p"$MYSQL_ROOT_PASSWORD"' > /some/path/on/your/host/all-databases.sql

or

$ docker exec mysql sh -c 'exec mysqldump dbname -uroot -p"$MYSQL_ROOT_PASSWORD"' > /some/path/on/your/host/dbname.sql

Example

$ docker exec mysql sh -c 'exec mysqldump test -uroot -p"$MYSQL_ROOT_PASSWORD"' > $(pwd)/data/db/dumps/test.sql

Generating SSL certificates

  1. Generate certificates

    $ docker run --rm -v $(pwd)/etc/ssl:/certificates -e "SERVER=localhost" jacoelho/generate-certificate
  2. Configure Nginx

    Edit nginx file etc/nginx/default.conf and uncomment the server section.

    # server {
    #     ...
    # }

Generating API Documentation

./web/app/vendor/apigen/apigen/bin/apigen generate -s web/app/src -d web/app/doc

Cleaning project

$ ./bin/linux/clean.sh $(pwd)

docker-nginx-php-mysql's People

Contributors

nanoninja avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.