-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from russellmacshane/docker
Converted from using Vagrant/Virtual box to Docker/Docker Compose
- Loading branch information
Showing
11 changed files
with
76 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
.vagrant | ||
*.log | ||
backup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM ubuntu:latest | ||
|
||
RUN apt update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt install -y \ | ||
sudo \ | ||
dialog \ | ||
apt-utils \ | ||
curl | ||
|
||
RUN adduser --disabled-password --gecos '' docker | ||
RUN adduser docker sudo | ||
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers | ||
|
||
USER docker | ||
|
||
COPY . /home/docker/quick-wordpress | ||
|
||
WORKDIR /home/docker/quick-wordpress | ||
|
||
RUN sudo chown -R docker:docker /home/docker/quick-wordpress/ | ||
|
||
RUN ./build.sh | ||
|
||
ENTRYPOINT ["./service-start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# Quick WordPress | ||
Quick WordPress Installation using Vagrant | ||
Quick WordPress Installation using Docker | ||
|
||
The goal of this project is to create a quick virtual machine setup with a WordPress installation for testing purposes. The following technologies are automatically installed for you: | ||
* Ubuntu Bionic (18.04) | ||
* Ubuntu | ||
* Apache | ||
* MariaDB | ||
* PHP | ||
|
@@ -11,29 +11,33 @@ The goal of this project is to create a quick virtual machine setup with a WordP | |
* WordPress | ||
|
||
## Pre-Installation | ||
1. Install [Vagrant](https://www.vagrantup.com/) | ||
2. Install [Virtual Box](https://www.virtualbox.org/) | ||
1. Install [Docker](https://docs.docker.com/get-docker/) | ||
2. Install [Docker Compose](https://docs.docker.com/compose/install/) | ||
|
||
## Installation Instructions | ||
1. Find a directory on your computer that you'd like to install this repo | ||
2. `$ git clone [email protected]:russellmacshane/quick-wordpress.git` or `git clone https://github.com/russellmacshane/quick-wordpress.git` if you don't have your [ssh keys setup](https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) | ||
3. `$ cd quick-wordpress` | ||
4. Your are strongly encouraged to modify the default passwords and WordPress setup information in the [config](./config) file | ||
5. `$ vagrant up` | ||
5. `$ docker-compose up -d` | ||
6. Grab some ☕️ coffee, it'll take a bit to install all the necessary dependencies | ||
|
||
## Usage | ||
1. Make sure the vagrant process is completed and your virtual machine is ready | ||
2. Point your web browser over to http://192.168.33.10/ to view your WordPress site | ||
3. You can also get to phpMyAdmin by going to http://192.168.33.10/phpmyadmin/ | ||
4. If you'd like to login into your virtual machine - `$ vagrant ssh` | ||
1. Make sure the container is up and running with `$ docker-compose ps` | ||
2. Point your web browser over to http://localhost/ to view your WordPress site | ||
3. You can also get to phpMyAdmin by going to http://localhost/phpmyadmin/ | ||
4. If you'd like to login into the container - `$ docker-compose exec qwp /bin/bash` | ||
5. WordPress files are located in `/var/www/html` and you can run WPCli commands from there | ||
6. This repo is mirrored from your local machine over to `/quick-wordpress` on your vm | ||
6. This repo is mirrored from your local machine over to `/home/docker/quick-wordpress` on your container | ||
|
||
## Backup and Restores | ||
1. In order to do backup and restores login to your virtual machine - `$ vagrant ssh` | ||
2. `$ qwcli backup` and follow the on screen instructions | ||
3. If you'd like to restore from a previous backup - `$ qwcli restore` and follow the on screen instructions | ||
1. In order to do backup and restores: | ||
2. `$ docker-compose exec qwp qwcli backup` and follow the on screen instructions | ||
3. If you'd like to restore from a previous backup - `$ docker-compose exec qwp qwcli restore` and follow the on screen instructions | ||
|
||
## Start and Stopping | ||
1. `$ docker-compose stop` to stop the container | ||
2. `$ docker-compose start` to bring it back up again | ||
|
||
## Cleanup | ||
1. If you are ready to delete your WordPress VM from you local machine - `$ vagrant destroy -f` | ||
1. If you are ready to delete your WordPress Container - `$ docker-compose down ` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ wp_db_password="wpdb-password" | |
|
||
# WordPress Site Details | ||
wp_version="latest" #wp_version="nightly" | ||
wp_site_title="Quick WordPress using Vagrant" | ||
wp_site_title="Quick WordPress using Docker" | ||
wp_admin_user="admin" | ||
wp_admin_password="wpadmin-password" | ||
wp_admin_email="[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: "3.8" | ||
services: | ||
qwp: | ||
build: . | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- .:/home/docker/quick-wordpress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
sudo service mysql restart | ||
sudo apache2ctl -D FOREGROUND |