sth-docker
. ├── .gitignore ├── LICENSE ├── README.md └── docker-compose.yaml
services:
wordpress:
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 80 of the Dockerized Wordpress container to port 80 of the host platform.
Everything is controlled with docker-compose
.
docker-compose up
Check containers are running and the port mapping:
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."
docker-compose down
Delete the referenced volumes with the -v
flag:
docker-compose down -v