Giter Club home page Giter Club logo

wordpress-docker-traefik's Introduction

Wordpress Docker Deployment - Traefik

Easy WordPress development with Docker and Docker Compose.

With this project you can quickly run the following:

Contents:

Requirements

Make sure you have the latest versions of Docker and Docker Compose installed on your machine.

Make sure to add your user to the docker group when using Linux.

Configuration

All the ENVIRONENTS are stored in the .env file that is created through ./create.sh

Installation

Open a terminal and run create.sh and enter in environment variables

For convenience you may add a new entry into your hosts file.

Usage

Starting containers

You can start the containers with the up command in daemon mode (by adding -d as an argument) or by using the start command:

docker-compose start

Stopping containers

docker-compose stop

Removing containers

To stop and remove all the containers use thedown command:

docker-compose down

Use -v if you need to remove the database volume which is used to persist the database:

docker-compose down -v

Creating database dumps

./export.sh

Developing a Theme

Configure the volume to load the theme in the container in the docker-compose.yml:

volumes:
  - ./theme-name/trunk/:/var/www/html/wp-content/themes/theme-name

Developing a Plugin

Configure the volume to load the plugin in the container in the docker-compose.yml:

volumes:
  - ./plugin-name/trunk/:/var/www/html/wp-content/plugins/plugin-name

WP CLI

The docker compose configuration also provides a service for using the WordPress CLI.

Sample command to install WordPress:

docker-compose run --rm wpcli core install --url=http://localhost --title=test --admin_user=admin [email protected]

Or to list installed plugins:

docker-compose run --rm wpcli plugin list

For an easier usage you may consider adding an alias for the CLI:

alias wp="docker-compose run --rm wpcli"

This way you can use the CLI command above as follows:

wp plugin list

wordpress-docker-traefik's People

Contributors

milleruk avatar nezhar avatar hacktohell avatar kadaliao avatar slhck avatar aeyzaz avatar ygotame avatar designorant avatar roschaefer avatar tjmoses avatar

Watchers

James Cloos avatar  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.