Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
Add wp-cli Option
Browse files Browse the repository at this point in the history
  • Loading branch information
evertramos committed Jul 25, 2018
1 parent 9ceb5b5 commit c40a8d8
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 0 deletions.
Binary file added .github/.README.md.swp
Binary file not shown.
58 changes: 58 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ services:
LETSENCRYPT_HOST: ${DOMAINS}
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}

# wpcli:
# image: tatemz/wp-cli
# volumes:
# - ${WP_CORE}:/var/www/html
# - ${WP_CONTENT}:/var/www/html/wp-content
# depends_on:
# - db
# entrypoint: wp

networks:
default:
external:
Expand Down Expand Up @@ -127,6 +136,55 @@ docker-compose up -d

----

# Further Options

## wp-cli (https://wp-cli.org/)

For whoever uses *wp-cli* here is how to implement it on this repo.


i. Take down your services

```bash
docker-compose down
```

ii. Uncomment the following lines on _docker-compose.yml_:

```bash
# wpcli:
# image: tatemz/wp-cli
# volumes:
# - ${WP_CORE}:/var/www/html
# - ${WP_CONTENT}:/var/www/html/wp-content
# depends_on:
# - db
# entrypoint: wp
```

iii. Start your services again

```bash
docker-compose up -d
```

iv. Test to see if it´s working

```bash
./wp-cli-test.sh

```

If you would, add the alias "wp" to your `.bash_aliases`:

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

Next time you need to run a wp-cli command just go to where you have your docker-compose file and run a `wp` command.

----

## Issues

Please be advised that if are running docker on azure servers you must mount your database in your disks partitions (exemple: `/mnt/data/`) so your db container can work. This is a some kind of issue regarding Hyper-V sharing drivers... not really sure why.
Expand Down
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ services:
LETSENCRYPT_HOST: ${DOMAINS}
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}

# wpcli:
# image: tatemz/wp-cli
# volumes:
# - ${WP_CORE}:/var/www/html
# - ${WP_CONTENT}:/var/www/html/wp-content
# depends_on:
# - db
# entrypoint: wp

networks:
default:
external:
Expand Down
7 changes: 7 additions & 0 deletions wp-cli-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

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

wp --info

exit 0
4 changes: 4 additions & 0 deletions wp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

docker-compose run --rm wpcli

0 comments on commit c40a8d8

Please sign in to comment.