Skip to content

Commit 20a3aaf

Browse files
authored
fix: LDP-2635: Use docker compose instead of docker-compose. (#74)
2 parents 2e18024 + 572ed2d commit 20a3aaf

File tree

2 files changed

+18
-25
lines changed

2 files changed

+18
-25
lines changed

.github/workflows/test-drupal-setup.yml

+3-10
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ jobs:
2727
key: ${{ runner.os }}-composer-v1-${{ hashFiles('./composer.json') }}
2828
restore-keys: |
2929
${{ runner.os }}-composer-v1
30-
- name: Install docker-compose.
31-
run: |
32-
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
33-
mkdir -p $DOCKER_CONFIG/cli-plugins
34-
curl -SL https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
35-
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
36-
docker-compose version
3730
- name: Install composer dependencies.
3831
run: |
3932
composer config platform-check false
@@ -47,12 +40,12 @@ jobs:
4740
shell: 'script -q -e -c "bash {0}"'
4841
run: |
4942
export COMPOSE_DEFAULT_USER=$(id -u $USER)
50-
docker-compose up -d
51-
echo "Waiting for mysql to come up..." && docker exec -it $(docker-compose ps -q cli) /bin/bash -c "while ! echo exit | nc mariadb 3306; do sleep 1; done" >/dev/null
43+
docker compose up -d
44+
echo "Waiting for mysql to come up..." && docker exec -it $(docker compose ps -q cli) /bin/bash -c "while ! echo exit | nc mariadb 3306; do sleep 1; done" >/dev/null
5245
- name: Install the project
5346
shell: 'script -q -e -c "bash {0}"'
5447
run: |
55-
docker-compose exec cli phapp install --no-build
48+
docker compose exec cli phapp install --no-build
5649
- name: Check connection and response of the site
5750
run: |
5851
curl -v http://example.drupal-project.localdev.space | grep "Drupal 10"

README.md.dist

+15-15
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This project is maintained using composer. Please refer to the documentation pro
55

66
## Prerequesites
77

8-
* Install docker and [docker-compose](https://docs.docker.com/compose/install/) - use version 1.22.0 or later.
8+
* Install docker and [docker compose](https://docs.docker.com/compose/install/) - use version 1.22.0 or later.
99

1010
* Install phapp (see tools) - or use the project-local version if preferred:
1111

@@ -18,7 +18,7 @@ This project is maintained using composer. Please refer to the documentation pro
1818
# Check ID:
1919
id -u $USER
2020
# If not 1000, run:
21-
echo "# Allow docker-compose setup to switch to the correct user." >> ~/.bashrc
21+
echo "# Allow docker compose setup to switch to the correct user." >> ~/.bashrc
2222
echo "export COMPOSE_DEFAULT_USER=$(id -u $USER)" >> ~/.bashrc
2323
bash
2424

@@ -28,20 +28,20 @@ To setup the project, ensure you have all prerequesites fullfilled and follow ne
2828

2929
* Optional: Drop container and data from previous runs:
3030

31-
docker-compose down -v
31+
docker compose down -v
3232

3333
* Initialize setup and run docker compose
3434

3535
phapp setup localdev
36-
docker-compose up -d --build
36+
docker compose up -d --build
3737

3838
* Build the app:
3939

4040
phapp build
4141

4242
* Run `phapp init` to quickly initialize the application.
4343

44-
docker-compose exec cli phapp init --no-build
44+
docker compose exec cli phapp init --no-build
4545

4646
## Localdev project URLs
4747

@@ -54,8 +54,8 @@ To setup the project, ensure you have all prerequesites fullfilled and follow ne
5454
For now most phapp and drush must be from inside the docker container.
5555
Do so via
5656

57-
docker-compose exec cli phapp init --no-build
58-
docker-compose exec cli drush cr
57+
docker compose exec cli phapp init --no-build
58+
docker compose exec cli drush cr
5959

6060
However, the exception is `phapp build`. Run it on the host so that your SSH key(s)
6161
are picked up and you can access private repositories:
@@ -64,7 +64,7 @@ are picked up and you can access private repositories:
6464

6565
During development it's convenient to permanently switch to the docker cli container:
6666

67-
docker-compose exec cli bash
67+
docker compose exec cli bash
6868
drush cr
6969

7070
## Command line tools
@@ -93,31 +93,31 @@ instructions on how to install phapp globally.
9393

9494
```
9595
# Get in the docker web container (where you can use the phapp commands)
96-
docker-compose exec cli bash
96+
docker compose exec cli bash
9797

9898
# Quick-install the application for development:
99-
docker-compose exec cli phapp init --no-build
99+
docker compose exec cli phapp init --no-build
100100

101101
# Update the build and run updates after switching branches:
102102
phapp build
103-
docker-compose exec cli phapp update --no-build
103+
docker compose exec cli phapp update --no-build
104104

105105
# Install the app from scratch:
106-
docker-compose exec cli phapp install
106+
docker compose exec cli phapp install
107107
```
108108
The commands executed can be found in `phapp.yml`.
109109

110110
- During development, some useful commands are:
111111

112112
```
113113
# Config export (export your config changes):
114-
docker-compose exec cli drush cex -y
114+
docker compose exec cli drush cex -y
115115

116116
# Config import (manual import of config files):
117-
docker-compose exec cli drush cim -y
117+
docker compose exec cli drush cim -y
118118

119119
# Cache clear/rebuild:
120-
docker-compose exec cli drush cr
120+
docker compose exec cli drush cr
121121
```
122122

123123
## Running tests

0 commit comments

Comments
 (0)