Code Monkey home page Code Monkey logo

wordpress-vip-boilerplate's Introduction

Docker local environment for WP VIP GO

This repository provides a local docker-based environment for WP VIP Go. It includes WordPress, MySql and phpmyadmin.

Installation

Docker Set up

  1. Install Docker
    • Mac OS: https://docs.docker.com/docker-for-mac/install/
    • Centos or Amazon Linux:
      [user]$ sudo yum update -y
      [user]$ sudo yum install -y docker
      [user]$ sudo service docker start
      [user]$ sudo usermod -aG docker user
    • Logout from the system and login again to apply last change.
  2. In order to verify docker installation:
    [user]$ docker info
  3. Install Docker Compose
    • Mac OS: Docker already include Compose
    • Centos or Amazon Linux:
      [user]$ sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
      sudo chmod +x /usr/local/bin/docker-compose
  4. In order to verify docker-compose installation:
    [user]$ docker-compose --version

Docker Set up

  1. Clone this repository
  2. Create a .env file based on the .env.template
  3. Run $ docker-compose up -d
  4. Run $ ./local_init.sh

The script will clone your repository and replace it with wp-content folder You can check out the logs of the installation using $ docker-compose logs -f

Once done, you should be able to access Wordpress at http://jam3site.local/wp-admin. You should see the default Wordpress setup screen.

DB Administration

PHPMyAdmin is installed by default locally and can be accessed at http://jam3site.local:8889/. If however you want to access the db using another tool, like Sequel Pro, you can comment out the PHPMyAdmin service from docker-compose.yml and add:

    ports:
      - "3306:3306"

to the mysql service. This will expose MySQL service to your local machine.

Setup Repository

  1. Synchronize the DB

Troubleshooting

Issue with some containers

Check the status of the containers using $ docker-compose ps.

Stopping containers

In the same folder where docker-compose up -d was executed do docker-compose stop the container will be stoped and the system is prepared to up new containers using same ports. Using docker ps we can see the container running and using docker stop CONTANINERID we can stop conatiners individually

Accessing containers

You can access the shell of a container using $ docker-compose exec SERVICENAME /bin/bash. So for example, docker-compose exec db /bin/bash will connect to the MySQL container, and then root@8d9a9bc9e2ea:/# echo $MYSQL_ROOT_PASSWORD will echo out your environment password.

Remove all the containers

In case something went wrong and you want to start over, you can use $ docker-compose down --volumes to remove all.

If you want to remove them entirely from the system, you can also run $ docker system prune -a to remove all stray, not running, images, containers, volumes, and networks.

Logging

Our docker-compose is running in background, if you want to check the logs use $docker-compose logs wordpress

wordpress-vip-boilerplate's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wordpress-vip-boilerplate's Issues

Support for HTTPS

Generate self-signed certificates for the domain specified in .env.

We can use https-portal for it

Automate the steps

Opportunities:

  1. Install WordPress using wp-cli
  2. Project repository cloning
  3. Cloning vip mu-plugins
  4. Syncronize the DB

Should MySQL port be exposed?

This is pretty much assuming local development, but would it make sense to add
ports: - "3306:3306"
to the mysql service to allow access to the DB from localhost. I like to use Sequel Pro, for example, and not the PHPMyAdmin that's included.

Wordpress CLI errors

screen shot 2019-02-20 at 12 01 29

screen shot 2019-02-20 at 12 01 36

Looks like wp-cli is throwing errors which is causing it to terminate, not be accessible. This should be fixed.

Support for PHPUnit

Include another Docker Compose file to run isolated tests, ex docker-compose.phpunit.yml

Include WP-CLI

Include wp-cli as part of docker-compose.

image: "wordpress:cli-php${PHP_VERSION:-7.2}"

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.