Skip to content

Commit

Permalink
Docs(sthd): corrected README to reflect changes
Browse files Browse the repository at this point in the history
  • Loading branch information
killshot13 committed Aug 22, 2021
1 parent 48e540b commit f06cc86
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,53 @@

## Dockerized Wordpress Environment w/ MySQL

### View Project Structure
### Project Structure

sth-docker

.
├── docker-compose.yaml
└── README.md
├── .gitignore
├── LICENSE
├── README.md
└── docker-compose.yaml

[_docker-compose.yaml_](docker-compose.yaml)

```yaml
services:
db:
image: mysql:8.0.19
...
wordpress:
image: wordpress:latest
image: wordpress
restart: always
ports:
- 80:80
volumes:
- ./wp:/var/www/html
...
db:
image: mysql:5.7
restart: always
volumes:
- db:/var/lib/mysql
...
volumes:
db:
```
If deployed, `docker-compose` will map port 81 of the Dockerized Wordpress container to port 81 of the host platform.
If deployed, `docker-compose` will map port 80 of the Dockerized Wordpress container to port 80 of the host platform.

### Install WP Dependencies

Everything is controlled with `docker-compose`.

```bash
$ docker-compose up -d
Creating network "wordpress-mysql_default" with the default driver
Creating volume "wordpress-mysql_db_data" with default driver
...
Creating wordpress-mysql_db_1 ... done
Creating wordpress-mysql_wordpress_1 ... done
docker-compose up
```

### Test Project Configuration

Check containers are running and the port mapping:

```bash
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5fbb4181a069 wordpress:latest "docker-entrypoint.s…" 35 seconds ago Up 34 seconds 0.0.0.0:80->80/tcp wordpress-mysql_wordpress_1
e0884a8d444d mysql:8.0.19 "docker-entrypoint.s…" 35 seconds ago Up 34 seconds 3306/tcp, 33060/tcp wordpress-mysql_db_1
```
Verify that a `wp` folder which contains the persistant filesystem has been created at the project root.

Navigate to `http://localhost:80` in your web browser to access Wordpress. You should see the screen about the "famous 5-minute WP installation."

Expand Down
12 changes: 6 additions & 6 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ services:
- 80:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepass
WORDPRESS_DB_NAME: exampledb
WORDPRESS_DB_USER: wpuser
WORDPRESS_DB_PASSWORD: wppasswd
WORDPRESS_DB_NAME: wpdbs
volumes:
- ./wp:/var/www/html

db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: exampledb
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepass
MYSQL_DATABASE: wpdbs
MYSQL_USER: wpuser
MYSQL_PASSWORD: wppasswd
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- db:/var/lib/mysql
Expand Down

0 comments on commit f06cc86

Please sign in to comment.