Coder Social home page Coder Social logo

henryvoorburg / docker-nginx-php-apache-mysql-nodejs-phpmyadmin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from igorsuhinin/docker-nginx-php-apache-mysql-nodejs-phpmyadmin

0.0 0.0 0.0 6 KB

Nginx + Php-fpm + Apache + MySQL + NodeJS + phpMyAdmin with Docker-Compose

PHP 0.91% Dockerfile 85.10% Shell 13.99%

docker-nginx-php-apache-mysql-nodejs-phpmyadmin's Introduction

Nginx + Php-fpm + Apache + MySQL + NodeJS + phpMyAdmin with Docker-Compose

Initial configuration to install a web environment with the following images:

  • nginx: it will be running as a reverse-proxy for Apache; the static data (images, texts, js scripts, etc) will be returned by nginx itself
  • Php-fpm 7.2: it will install composer and try to run it with composer install
  • Apache (httpd): it will be proxying the requests to PHP-FPM
  • MySQL 8: default access credentials are defined in .env file incl. the root password
  • NodeJS: will try to run npm run dev or npm run dev depending on the settings defined in .env file
  • phpMyAdmin: it will be available on the port 5426, e.g. http://localhost:5426

Prerequisites

Please make sure docker & docker-compose are installed on the target machine.

If you are not sure, please run the following command (Ubuntu):

sudo apt-get install docker docker-compose -y

Initial Settings

Navigate to the root directory and open .env file for editing:

# App Settings
APP_NAME=docker
APP_PATH=./app
# To launch the app in dev environment just remove prod
APP_ENV=prod

Run Docker-Compose

To build the images and run the configuration please navigate to the root directory and run the following command

docker-compose up -d --build

Remove option -d if you don't want to run it in the detached mode.

If the images are already built just run the following command

docker-compose up -d

Docker Management

Start Docker containers

When the containers are built you can start the containers by using the following command

docker-compose up OR docker-compose up -d for the detached mode.

Stop Docker containers

To stop Docker containers you can use the following command

docker-compose down

Log in to Containers

To log in to the container you can use one of the following commands

  • NGINX: docker-compose exec web sh

  • PHP: docker-compose exec php sh

  • APACHE: docker-compose exec apache sh

  • MYSQL: docker-compose exec db sh

  • NODEJS: docker-compose exec nodejs sh

  • PHPMYADMIN: docker-compose exec phpmyadmin sh

Troubleshooting

  • Docker can't run the container on the default port 80: Please check if there is no other app which uses the same port on your machine. You can also change the default port for nginx in the file docker-compose.yml.
  • Can't log in to php container: Please check all running Docker processes by using the following command docker-compose ps. Check if you are using the correct name.

docker-nginx-php-apache-mysql-nodejs-phpmyadmin's People

Contributors

igorsuhinin 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.