Giter VIP home page Giter VIP logo

docker-centos-nginx-php's Introduction

Created by Kaushal Kishore
Email : [email protected]
Website : http://www.kaushalkishore.com

Dockerfile for creating docker image for Centos-Nginx-PHP (Centos, Nginx, PHP-FPM)

Steps for creating image from the Docker-Centos-Nginx-PHP:

Step 1 : Clone the Docker-Centos-Nginx-PHP.git

Command: 
git clone https://github.com/kaushalkishorejaiswal/Docker-Centos-Nginx-PHP.git

Step 2 : Change the directory to the clone folder

Command:
cd Docker-Centos-Nginx-PHP

Step 3 : Create the Docker Image

Command: 
sudo docker build -t ##NAME_OF_YOUR_DOCKER_IMAGE## .
Note : 
  a). This command will be fired where the DockerFile will be placed
  b). ##NAME_OF_YOUR_DOCKER_IMAGE## : Replace it with your image name
  c). . : (.) Symbols shows that your Dockerfile is available on the same directory where you are running the command.

Step 4 : Create an Centos, Nginx, PHP-FPM Installed Container from the image

Command Syntax: 
sudo docker run --name [container name] -p [port to access (New Port):port exposed(original port)] -i -t [image name]
Command:
sudo docker run --name ##NAME_OF_YOUR_DOCKER_CONTAINER## -d -p 8082:80 ##NAME_OF_YOUR_DOCKER_IMAGE##

Step 5 : Now you can access your Nginx container from your web browser.

Command:
http://127.0.0.1:8082/

Some other important commands:

  • docker images : To list all the images of your docker
  • docker ps : To list all the runing containers
  • docker kill ##CONTAINER_NAME## : To kill the runing container
  • docker rm ##CONTAINER_NAME## : To delete the container from the system.
  • docker inspect ##CONTAINER_NAME## : To get all the information about the container.
  • docker logs ##CONTAINER_NAME## : To get the logs of the container.
  • docker ps -a: To get the listing of all the containers.

Additional Notes:

Command for attaching the volume of your hosted machine:
Command Syntax:
sudo docker run --name ##NAME_OF_YOUR_DOCKER_CONTAINER## -d -p 8082:80 -v ##HOSTED_VOLUME_LOCATION##:##CONTAINER_VOLUME_LOCATION## ##YOUR_IMAGE_NAME##
Command Example:
sudo docker run --name apache_ins -d -p 8082:80 -v /var/www/kaushal:/var/www kaushal_nginx

docker-centos-nginx-php's People

Contributors

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