Docker for Wordpress
- Clone repo in folder
.docker
inside project. - Go inside
.docker
folder and copy.env.sample
to.env
file. Edit.env
. - Run
docker-run.sh
.
Wordpress site access on http://localhost
.
All tested on Windows 10 host, Docker Desktop v3.0.4.51218, HyperV.
web_server
- Wordpress containerdb_server
- Database containermailhog_server
- Mailhog for emails.adminer
- DB management container
- Web server -
http://localhost:80
(in.env
file -WEB_PORT
) - DB server -
http://localhost:1306
(in.env
file -DB_PORT
) - Mailhog -
http://localhost:8025
(in.env
file -MAILHOG_PORT
) - Adminer -
http://localhost:8081
(in.env
file -DBADMIN_PORT
)
If need set some custom domain:
- Set
APP_URL
in.env
file - needed domain. For exampledomain.test
. - In
hosts
file of the host system add line for domain127.0.0.1 domain.test
. - Reload docker
- Now site available in browser on
http://domain.test
docker-run.sh
- run the containersdocker-stop.sh
- stop containersdocker-db.sh
- open terminal indb_server
containerdocker-web.sh
- open terminal inweb_server
containerdocker-export-db.sh
- save DB dump to external filecompose/dbdump/dump.sql
docker-import-db.sh
- import dumpcompose/dbdump/dump.sql
to DB