Skip to content

Create an environnement Apache, PHP, MySQL and latest wordpress site ready to develop

Notifications You must be signed in to change notification settings

dgnguyen/dockerWordpress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker WordPress

This Docker configuration install all you need for a functional wordpress site (Apache, PHP, MysqL, PHPMyadmin, Wordpress latest)

1- Useful links :

2- Step by step :

  • Create new wordpress site folder in www/
  • Add wordpress image in /docker-compose.yml :
###########################
# Setup the Wordpress container
###########################
    wordpress:
        container_name: dockerapache_wordpress
        image: wordpress:latest
        ports:
            - 3000:80
        environment:
            - WORDPRESS_DB_HOST=mysql
            - WORDPRESS_DB_USER=project
            - WORDPRESS_DB_PASSWORD=project
            - WORDPRESS_DB_NAME=project
        volumes:
            - ./www/wordpress:/var/www/html
            - ./www/wordpress/wp-content:/var/www/html/wp-content
        links:
            - mysql:mysql
###########################
  • Create new Apache configuration of new wordpress site in /apache/vhosts/wordpress.conf

  • Docker Start : docker-compose up -d

    • The localhost will be available at: localhost:8080 (port can be changed in docker-compose.yml)  - The wordpress site will be created inside /www/ and availabe at : localhost:3000 (port can be changed in docker-compose.yml)
    • PHPMyadmin : localhost:8081 (port can be changed in docker-compose.yml)
  • Usefuls Docker commands:

    • docker-compose up/down (Start/Stop docker env)
    • docker-compose rm -v (remove all running docker)
    • docker-compose ps (list all running docker)

Warning : Sometimes, an error like "Bind for 0.0.0.0:XX failed: port is already allocated" will show up while we running docker-compose up. That mean that the port has been taken and docker can't run container on it. Restarting docker will resolve this error

About

Create an environnement Apache, PHP, MySQL and latest wordpress site ready to develop

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published