Coder Social home page Coder Social logo

docker-wordpress-scripts's Introduction

Docker WordPress Scripts

โœจ This project is not under active development. It may not work with the latest Docker. Future DWS updates uncertain at this time. โœจ


๐Ÿค– Docker WordPress Scripts

npm version

DWS is a small set of scripts to manage WordPress containers in Docker. It uses a Traefik docker network for *.localhost domains to avoid manual port assignment.

This is work in progress and unstable!

This is somewhat of a personal project but it solves a fairly common problem so I'm sharing it for anyone to use and adapt. Follow @dbushell for updates and feedback.

Requirements

Install

Run npm init if you don't have a package.json.

Install docker-wordpress-scripts to the project repository:

npm install docker-wordpress-scripts --save

Or use the --global flag to use dws commands anywhere without npx.

Usage

Usage: dws <command> [options]

Commands:
  dws up            spin up a new project
  dws stop          stop running containers
  dws start         start existing containers
  dws url           output the *.localhost URL
  dws down          stop and remove existing containers
  dws eject         replace DWS dependency with config files

Options:
  --help, -h     Show help
  --version, -v  Show version number

up

npx dws up

DWS will spin up new Docker containers and install WordPress. You'll be asked a few configuration values.

Once successful you'll see:

๐Ÿค– Success: WordPress is up and running!
phpMyAdmin: โžœ http://pma.wordpress.localhost
WordPress:  โžœ http://wordpress.localhost
WordPress (auto login):  โžœ http://wordpress.localhost/wp-auto-login.php

The wp-content directory is mounted to wordpress in the project repository.

stop

npx dws stop

Stop all running containers for the project.

start

npx dws start

Start all existing containers for the project.

url

npx dws url

Output the *.localhost URL for the project.

down

npx dws down

Stop and remove all containers and volumes for the project leaving no trace in Docker. The WordPress content directories will persist in the project repository.

eject

npx dws eject

Remove the DWS dependency. There is no going back! This adds a copy of docker-compose.yml and other config files to the project repository. You can continue by using docker-compose in the terminal.

The hostname & port for WordPress and phpMyAdmin moves to respectively:

localhost:8080
localhost:8081

NGINX and Portainer

See v0.9.1 for older configurations.


MIT License | Copyright ยฉ 2021 David Bushell | @dbushell

docker-wordpress-scripts's People

Contributors

dbushell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

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