Building the development environment quickly.
Copy the .env.example file to .env.
docker-compose build
docker-compose up -d
# Build the specific image
docker-compose build php71
docker-compose build golang
docker-compose up -d
docker-compose down
docker-compose exec nginx bash
docker-compose exec php71 /bin/sh
docker-compose exec php74 /bin/sh
docker-compose exec php80 /bin/sh
docker-compose exec php81 /bin/sh
docker-compose exec php82 /bin/sh
docker-compose exec redis /bin/sh
docker-compose exec mysql57 bash
docker-compose exec mysql80 bash
docker-compose exec mariadb bash
docker-compose exec golang bash
All the containers' working directory is www.
docker-compose restart nginx
docker-compose restart mysql80
Or just restart all services. If you have changed the service's configurations, stop all services first to avoid read the old settings.
docker-compose down
docker-compose up -d
Version |
---|
latest |
Store your nginx configurations in the conf folder folder using a file extension of conf.template
. After create or edit the conf file you need to restart the service.
docker-compose down
docker-compose up -d
File | URL |
---|---|
default-site.conf.template | http://127.0.0.1:1001/phpinfo http://127.0.0.1:1001/opcache |
default-ssl.conf.template | https://127.0.0.1:1002/phpinfo http://127.0.0.1:1002/opcache |
default-swoole.conf.template | https://127.0.0.1:1003/7.4 https://127.0.0.1:1003/8.0 https://127.0.0.1:1003/8.1 https://127.0.0.1:1003/8.2 |
project-site.conf.template | http://127.0.0.1:1011 |
project-ssl.conf.template | https://127.0.0.1:1012 |
project-swoole.conf.template | https://127.0.0.1:1013 |
variable | default |
---|---|
PHPINFO_PORT | 1001 |
PHPINFO_SSL_PORT | 1002 |
PHPINFO_SWOOLE_PORT | 1003 |
DEFAULT_SITE_PORT | 1011 |
DEFAULT_SITE_SSL_PORT | 1012 |
DEFAULT_SITE_SWOOLE_PORT | 1013 |
Version | Swoole | ImageMagick | Opache |
---|---|---|---|
5.6 | |||
7.1 | v | ||
7.4 | v | v | v |
8.0 | v | v | v |
8.1 | v | v | v |
8.2 | v | v | v |
docker-compose exec php71 /bin/sh
docker-compose exec php74 /bin/sh
docker-compose exec php80 /bin/sh
docker-compose exec php81 /bin/sh
docker-compose exec php82 /bin/sh
- After entering the php container, this command can install the laravel project.
composer create-project --prefer-dist laravel/laravel blog
- Create the conf file in nginx.
- After entering the php container, run the swoole.php.
php swoole.php
- Create the conf file in nginx.
- Run the test.sh for testing the ImageMagick commands.
docker-compose exec php80 /bin/sh cd ../imagick sh test.sh
configuration | variable | default |
---|---|---|
web ui port | SUPERVISOR_PORT | 1040 |
docker-compose exec supervisor bash
Version | phpmyadmin |
---|---|
5.7 | v |
8.0 | v |
configuration | variable | default |
---|---|---|
port of mysql 5.7 | MYSQL_57_PORT | 4306 |
port of mysql 8.0 | MYSQL_80_PORT | 5306 |
allow empty password | MYSQL_ALLOW_EMPTY_PASSWORD | yes |
root password | MYSQL_ROOT_PASSWORD | (empty) |
You can choose any version of mysql you want. And the working directory is www, put the sql files in this folder for importing easily.
docker-compose exec mysql57 bash
mysql -u root -p
Another way to connect the mysql service without entering the container is using the mysql client command.
mysql --host=localhost --port=6306 -uroot --default-character-set=utf8
Version | phpmyadmin |
---|---|
10.2.10 | v |
configuration | variable | default |
---|---|---|
port | MARIADB_PORT | 6306 |
The working directory is www, put the sql files in this folder for importing easily.
docker-compose exec mariadb bash
Version | phpredisadmin |
---|---|
latest | v |
configuration | variable | default |
---|---|---|
port | REDIS_PORT | 6379 |
docker-compose exec redis /bin/sh
redis-cli --raw
configuration | variable | default |
---|---|---|
port | PHPMYADMIN_PORT | 81 |
configuration | variable | default |
---|---|---|
port | REDISMYADMIN_PORT | 82 |
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout ssl.key -out ssl.csr
Version | Tesseract OCR | ImageMagick |
---|---|---|
latest | v |
After enter the container the working directory is www.
docker-compose exec golang bash
tesseract --version