-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #646 from boxuk/improvement/docker-commands
[REFACTOR] Improvements to the way Docker commands are run
- Loading branch information
Showing
8 changed files
with
28 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
docker-compose exec --user www-data app ./bin/clearcache "$@"; | ||
bin/docker/php ./bin/clearcache "$@"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
docker-compose exec -T --user www-data app php -d memory_limit=1G /usr/local/bin/composer "$@" | ||
bin/docker/php /usr/local/bin/composer "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
# if node is already running, use it | ||
|
||
if [ "$(docker inspect -f '{{.State.Running}}' nodejs 2>/dev/null)" = "true" ]; then | ||
docker exec -it nodejs "$@" | ||
else | ||
docker compose run --rm nodejs "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
docker compose -f docker-compose.yml run -T --rm --workdir /usr/src/app nodejs npm "$@" | ||
bin/docker/nodejs npm "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# If container is running, exec inside, else run a new container | ||
if [ "$(docker inspect -f '{{.State.Running}}' app 2>/dev/null)" = "true" ]; then | ||
docker-compose exec --user www-data app php -d memory_limit=1G "$@" | ||
else | ||
docker-compose run --rm --user www-data app php -d memory_limit=1G "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
#!/usr/bin/env bash | ||
|
||
bin/docker/composer run phpstan "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
docker-compose exec --user www-data app php -d memory_limit=1G /usr/local/bin/wp "$@" | ||
bin/docker/php /usr/local/bin/wp "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters