chmod 0444 my.cnf
Install docker and docker-compose by yourself.
- Copy docker-compose-example.yml to docker-compose.yml
- Put your site and rename to ./html
- Run
docker-compose up -d
- visit your site by server IP + nginx port (Local development is 127.0.0.1).
- Copy docker-compose-example.yml to docker-compose.yml
- Change
- ./html:/var/www/html
to- ./www:/var/www
- Run
docker-compose up -d
- Put your drupal code to www, like www/drupalsitea, www/drupalsiteb
( Optional ) Use composer to download a new site:
Rundocker exec -it d9 bash
to get into the php/nginx container,
Swich to /var/wwwcd /var/www
,
Then use composer to create a new drupal sitecomposer create-project drupal/recommended-project my_site_name_dir
- The d9 container has a nginx config to direct <directory_name>.dpw /var/www/directory_name, so you can visit your site by drupalsitea.dpw, drupalsiteb.dpw after put it to your composer's hosts ( Linux/Mac: /etc/hosts ).