Skip to content

Dockerize php aplication with mysql , containt docker-compose.yml Docker file

Notifications You must be signed in to change notification settings

annaaz/dockerize-php-application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dockerize PHP Application

Easily setting up docker environment , to run simple php script, here already provide Dockerfile and docker-compose.yml . Just follow these instruction to dockerize php application

disclaimer : only provided simple setup for development / research purpose only .

Technical notes :

  • PHP version is php php:7.4-apache
  • image: mydemophpimage
  • ports:
    • "80:80"
    • "443:443"
  • volumes:
    • ./app:/var/www/html
  • network : test

Here we will run php script inside app folder kindly follow these detail instruction :

  • Initate with clone repository

  • Enter root directory with terminal

  • Run this command docker build -t mydemophpimage .

    notes : mydemophpimage is image name
  • Make sure u get succes message without error

  • Then you can display docker image that already create with : docker image ls | grep mydemophpimage

  • After image already succesfully create we can run this commad to run the image docker compose up you can add **-d ** if you want run in it , in the background

Additonal notes :

  • docker ps | grep mydemophpimage : command for check exisiting proses .
  • docker exec -it docker_file_container_name bash : commad for acces the docker server more less ssh access .

About

Dockerize php aplication with mysql , containt docker-compose.yml Docker file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published