Docker XNMP Development
Cross-Platform (X), Nginx (N), MariaDB (M), PHP (P)
Read More: Guide to build XNMP-VHOSTS
- install Docker https://www.docker.com/
docker-compose up
Available pages
- check default page: http://localhost
- check default page: http://example.com.localhost
- check default page: http://test.example.com.localhost
- check default page: http://php5.localhost
- check default page: http://php7.localhost
- check default page: http://php7-ext.localhost
- check default page: http://php8.localhost
- check default page: http://php8-ext.localhost
- check default page: http://ssl.localhost
- check default page: http://test.ssl.localhost
Make sure you set your host file these domains to 127.0.0.1
- check: http://localhost:8080/
- user: root, pass: root
Run shell from a running docker container
Check Docker Network
docker network ls
remember
NAME
for--net
flag
Which docker container runs my database
docker ps
remember
NAMES
for--link
flag
docker run --rm --net docker-xnmp-vhosts_default --link docker-xnmp-vhosts_db_1:db -it alpine:latest /bin/sh
db
is the custom link name (host) you want to connect later in Alpine Shell You will go inside Alpine Shell
# install mysql-client
apk add --update mysql-client
# open mysql shell and connect to host 'db'
mysql -h db
Make localhost domains work with HTTPS
Go to nginx/bin
directory and run from there:
./createNginxSslConfigFile.sh
This will create:
- nginx/certificates/RootCA.crt
- nginx/certificates/RootCA.pem
- nginx/certificates/RootCA.key
- nginx/certificates/RootCA.srl
- nginx/certificates/localhost/localhost.crt
- nginx/certificates/localhost/localhost.key
- nginx/certificates/localhost/localhost.csr
- nginx/enabled/ssl.conf
Check https://www.bounca.org/tutorials/install_root_certificate.html
how to install RootCA.(crt|pem)
and RootCA.key
in your system
After installing RootCA's you might reboot your computer, to make
localhost/localhost.*
files work for your https connections