Skip to content

Commit 6f90114

Browse files
committed
Use docker compose and not docker-compose.
1 parent 43c4e08 commit 6f90114

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ jobs:
2929
- name: Bring up the environment.
3030
run: |
3131
cp tests/docker-compose.yml ./docker-compose.yml
32-
docker-compose up -d
32+
docker compose up -d
3333
while ! mysqladmin ping -h127.0.0.1 -u drupal -pdrupal --silent; do
3434
sleep 1
3535
done
3636
3737
- name: Install Drupal.
3838
run: >
39-
docker-compose exec -T drupal bash -c
39+
docker compose exec -T drupal bash -c
4040
'drush site:install minimal
4141
--db-url="mysql://drupal:$DRUPAL_DATABASE_PASSWORD@$DRUPAL_DATABASE_HOST/drupal"
4242
--site-name="Drupal Example Site for Kubernetes"

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ Please read through the [project documentation](docs/README.md) for details abou
2121
1. Run the local development environment:
2222
2323
```
24-
docker-compose up -d
24+
docker compose up -d
2525
```
2626
27-
(Wait for the environment to come up—you can monitor the logs with `docker-compose logs -f`).
27+
(Wait for the environment to come up—you can monitor the logs with `docker compose logs -f`).
2828
2929
1. Once the container is running, install Dependencies and install Drupal. You can either access http://localhost/ and install using the UI, or install via Drush:
3030
3131
```
3232
# Install dependencies.
33-
docker-compose exec drupal composer install
33+
docker compose exec drupal composer install
3434
3535
# Install Drupal.
36-
docker-compose exec drupal bash -c 'drush site:install minimal --db-url="mysql://drupal:$DRUPAL_DATABASE_PASSWORD@$DRUPAL_DATABASE_HOST/drupal" --site-name="Drupal Example Site for Kubernetes" --existing-config -y'
36+
docker compose exec drupal bash -c 'drush site:install minimal --db-url="mysql://drupal:$DRUPAL_DATABASE_PASSWORD@$DRUPAL_DATABASE_HOST/drupal" --site-name="Drupal Example Site for Kubernetes" --existing-config -y'
3737
```
3838
3939
1. Visit http://localhost/ in your browser, and login as `admin` using the password Drush printed in the 'Installation complete' message.
@@ -44,24 +44,24 @@ Please read through the [project documentation](docs/README.md) for details abou
4444
4545
After making any configuration changes on the website, you can export the configuration to disk so it can be preserved in the codebase and deployed to the production site:
4646
47-
docker-compose exec drupal bash -c 'drush config:export -y'
47+
docker compose exec drupal bash -c 'drush config:export -y'
4848
4949
For more on the way this project's configuration changes are handled, and the general site development process, see the [project documentation](docs/README.md).
5050
5151
### Exporting Content
5252
5353
After making any content changes on the website, you can export the changes to disk so it is preserved in the codebase and installable on the production site:
5454
55-
docker-compose exec drupal bash -c 'drush dcer --folder=modules/custom/pidramble_default_content/content/ node 1'
55+
docker compose exec drupal bash -c 'drush dcer --folder=modules/custom/pidramble_default_content/content/ node 1'
5656
5757
For more on the way this project's content changes are handled, see the [pidramble_default_content README](web/modules/custom/pidramble_default_content/README.md).
5858
5959
### Upgrading Core (and Contrib)
6060
6161
1. Set up the site like normal, make sure it's installed.
62-
2. Run `docker-compose exec drupal composer update` (to update everything).
63-
3. Run `docker-compose exec drupal bash -c 'drush updb -y'`
64-
4. Run `docker-compose exec drupal bash -c 'drush config:export -y'`
62+
2. Run `docker compose exec drupal composer update` (to update everything).
63+
3. Run `docker compose exec drupal bash -c 'drush updb -y'`
64+
4. Run `docker compose exec drupal bash -c 'drush config:export -y'`
6565
5. Commit any changes and push them.
6666
6767
## License

docs/add-custom-theme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ However, you need to remember to _export the site's configuration_ now, so the t
2222
1. Run the command:
2323

2424
```
25-
docker-compose exec drupal bash -c 'drush config:export -y'
25+
docker compose exec drupal bash -c 'drush config:export -y'
2626
```
2727
2828
1. Commit the changed configuration to Git:

docs/configure-and-reproduce.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ For Drupal 8+, that means using _configuration_ to synchronize changes between a
66

77
Before we can start doing this work, we need to make sure we have our local environment set up to allow us to work in the Docker environment, but also have our codebase changes reflected locally (outside of the running Docker container), so we can commit any changes to our Git codebase.
88

9-
## Local Development with `docker-compose`
9+
## Local Development with `docker compose`
1010

1111
The first step is to modify the `docker-compose.yml` file so it has a `volume` which shares the local codebase into the Drupal container:
1212

13-
1. If you already have the Docker environment running from the previous guide, make sure it is completely removed using `docker-compose down -v`.
13+
1. If you already have the Docker environment running from the previous guide, make sure it is completely removed using `docker compose down -v`.
1414
1. Since we'll be using the local codebase to drive the Drupal site (instead of the Drupal codebase only available inside the Drupal container), we need to install Composer dependencies locally:
1515

1616
```
@@ -22,7 +22,7 @@ The first step is to modify the `docker-compose.yml` file so it has a `volume` w
2222
1. Start the local development environment:
2323
2424
```
25-
docker-compose up -d
25+
docker compose up -d
2626
```
2727
2828
1. Install Drupal using the same Drush command used in the previous guide, [Starting a new Drupal Project](starting-new-project.md).
@@ -52,15 +52,15 @@ So let's do something I do for all my Drupal sites: install the [Admin Toolbar](
5252
1. Now run the following command to tell Drupal to dump its current configuration into the 'config sync' directory:
5353
5454
```
55-
docker-compose exec drupal bash -c 'drush config:export -y'
55+
docker compose exec drupal bash -c 'drush config:export -y'
5656
```
5757
5858
1. If you look inside the `config/sync` folder you should now see lots of YAML files (ending with `.yml`), containing all the details of your Drupal site's configuration.
5959
1. Now is where this gets interesting; let's say you then make some other changes to your site configuration, but you want to ditch them because you weren't happy with them. For example, go to the Basic site settings page (`/admin/config/system/site-information`) and change the Slogan to "The best website ever" and save it.
6060
1. You can now _reinstall_ the site from scratch, but using the configuration you previously exported (so it will have the Admin Toolbar module and everything else, but not this silly slogan you don't like), by adding the flag `--existing-config` to the install command:
6161
6262
```
63-
docker-compose exec drupal bash -c 'drush site:install minimal --db-url="mysql://drupal:$DRUPAL_DATABASE_PASSWORD@$DRUPAL_DATABASE_HOST/drupal" --site-name="My Drupal Site" --existing-config -y'
63+
docker compose exec drupal bash -c 'drush site:install minimal --db-url="mysql://drupal:$DRUPAL_DATABASE_PASSWORD@$DRUPAL_DATABASE_HOST/drupal" --site-name="My Drupal Site" --existing-config -y'
6464
```
6565
6666
1. A minute or so later, if you log into the site using the `admin` user and the new password Drush prints to the command line, you'll see that the Slogan was reverted to being blank, as it was before you changed it.

docs/create-default-content.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Anyways, let's get started with Default Content:
4949
1. Once you're satisfied things worked correctly, go ahead and export the site configuration so the Default Content module and your site's default content module are enabled:
5050
5151
```
52-
docker-compose exec drupal bash -c 'drush config:export -y'
52+
docker compose exec drupal bash -c 'drush config:export -y'
5353
```
5454
5555
1. Reinstall Drupal from scratch, and you _should_ see that not only is the Drupal site back the same way you had configured it, there are also entities that are recreated after an install which should be helpful for local development and theming.

docs/starting-new-project.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ Part of the purpose of this project is to outline the exact steps required to bu
3737
1. Verify you can run the site in the container image locally:
3838
3939
```
40-
docker-compose up -d
40+
docker compose up -d
4141
```
4242
43-
(Wait for the environment to come up—you can monitor the logs with `docker-compose logs -f`).
43+
(Wait for the environment to come up—you can monitor the logs with `docker compose logs -f`).
4444
4545
1. Once the container is running, you need to install Drupal. You can either access http://localhost/ and install using the UI, or install via Drush:
4646
4747
```
48-
docker-compose exec drupal bash -c 'drush site:install minimal --db-url="mysql://drupal:$DRUPAL_DATABASE_PASSWORD@$DRUPAL_DATABASE_HOST/drupal" --site-name="My Drupal Site" -y'
48+
docker compose exec drupal bash -c 'drush site:install minimal --db-url="mysql://drupal:$DRUPAL_DATABASE_PASSWORD@$DRUPAL_DATABASE_HOST/drupal" --site-name="My Drupal Site" -y'
4949
```
5050
5151
1. Visit http://localhost/ in your browser, and login as `admin` using the password Drush printed in the 'Installation complete' message.

0 commit comments

Comments
 (0)