-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(run): custom script runner (#17)
- Loading branch information
1 parent
b1e9ab7
commit 053cdaa
Showing
7 changed files
with
106 additions
and
7 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
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
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,7 @@ | ||
# Examples | ||
|
||
- [With custom scripts](./with-custom-scripts/) | ||
|
||
## Contributing | ||
|
||
Feel free to contribute to this project to add more documentation and examples! |
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,35 @@ | ||
# Example: with custom scripts | ||
|
||
This is an example of a running PrestaShop Flashlight with custom scripts. | ||
See [./init-scripts](./init-scripts). | ||
|
||
## Test the example | ||
|
||
The expected output of this example is: | ||
|
||
``` | ||
❯ docker-compose up prestashop | ||
[+] Building 0.0s (0/0) docker:desktop-linux | ||
[+] Running 3/2 | ||
✔ Network with-custom-scripts_default Created 0.0s | ||
✔ Container with-custom-scripts-mysql-1 Created 0.0s | ||
✔ Container with-custom-scripts-prestashop-1 Created 0.0s | ||
Attaching to with-custom-scripts-prestashop-1 | ||
with-custom-scripts-prestashop-1 | * Applying PS_DOMAIN (localhost:8000) to the dump... | ||
with-custom-scripts-prestashop-1 | * Checking MySQL connectivity... | ||
with-custom-scripts-prestashop-1 | * PHP PDO connectivity checked | ||
with-custom-scripts-prestashop-1 | * PrestaShop MySQL client configuration set | ||
with-custom-scripts-prestashop-1 | * Restoring MySQL dump... | ||
with-custom-scripts-prestashop-1 | * MySQL dump restored! | ||
with-custom-scripts-prestashop-1 | * Running init script(s)... | ||
with-custom-scripts-prestashop-1 | --> Running /tmp/init-scripts/01-bretzel.sh... | ||
with-custom-scripts-prestashop-1 | * 🥨 01 bretzel here | ||
with-custom-scripts-prestashop-1 | CUSTOM_FOO contains bar | ||
with-custom-scripts-prestashop-1 | | ||
with-custom-scripts-prestashop-1 | --> Running /tmp/init-scripts/02-tarte-flambee.sh... | ||
with-custom-scripts-prestashop-1 | * 🍕 02 tarte flambée here | ||
with-custom-scripts-prestashop-1 | CUSTOM_MUSH contains room | ||
with-custom-scripts-prestashop-1 | | ||
with-custom-scripts-prestashop-1 | * Starting php-fpm... | ||
with-custom-scripts-prestashop-1 | * Starting nginx... | ||
``` |
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,44 @@ | ||
services: | ||
prestashop: | ||
image: prestashop/prestashop-flashlight:latest | ||
healthcheck: | ||
test: ["CMD-SHELL", "curl -Isf http://localhost:80/robots.txt || exit 1"] | ||
interval: 30s | ||
timeout: 10s | ||
retries: 10 | ||
depends_on: | ||
mysql: | ||
condition: service_healthy | ||
environment: | ||
- PS_DOMAIN=localhost:8000 | ||
- CUSTOM_FOO=bar | ||
- CUSTOM_MUSH=room | ||
volumes: | ||
- ./init-scripts:/tmp/init-scripts | ||
ports: | ||
- 8000:80 | ||
|
||
mysql: | ||
image: mariadb:lts | ||
healthcheck: | ||
test: | ||
[ | ||
"CMD", | ||
"mysqladmin", | ||
"ping", | ||
"--host=localhost", | ||
"--user=root", | ||
"--password=prestashop", | ||
] | ||
interval: 10s | ||
timeout: 10s | ||
retries: 5 | ||
environment: | ||
- MYSQL_HOST=mysql | ||
- MYSQL_USER=prestashop | ||
- MYSQL_PASSWORD=prestashop | ||
- MYSQL_ROOT_PASSWORD=prestashop | ||
- MYSQL_PORT=3306 | ||
- MYSQL_DATABASE=prestashop | ||
ports: | ||
- 3306:3306 |
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,4 @@ | ||
#!/bin/sh | ||
echo "* 🥨 01 bretzel here" | ||
echo "CUSTOM_FOO contains $CUSTOM_FOO" | ||
|
3 changes: 3 additions & 0 deletions
3
examples/with-custom-scripts/init-scripts/02-tarte-flambee.sh
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,3 @@ | ||
#!/bin/sh | ||
echo "* 🍕 02 tarte flambée here" | ||
echo "CUSTOM_MUSH contains $CUSTOM_MUSH" |