{"id":15145662,"url":"https://github.com/prestashopcorp/prestashop-flashlight","last_synced_at":"2025-09-29T15:30:57.667Z","repository":{"id":177419866,"uuid":"602018178","full_name":"PrestaShopCorp/prestashop-flashlight","owner":"PrestaShopCorp","description":"A docker based testing utility for PrestaShop","archived":true,"fork":false,"pushed_at":"2023-08-23T07:40:42.000Z","size":143,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-09-27T11:41:28.960Z","etag":null,"topics":["arm64","docker","prestashop","testing"],"latest_commit_sha":null,"homepage":"https://prestashop.com","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"osl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PrestaShopCorp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-15T10:23:20.000Z","updated_at":"2023-09-28T11:43:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"6dc2e4d1-cee5-42d5-b563-94af54adf88e","html_url":"https://github.com/PrestaShopCorp/prestashop-flashlight","commit_stats":null,"previous_names":["prestashopcorp/prestashop-flashlight"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrestaShopCorp%2Fprestashop-flashlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrestaShopCorp%2Fprestashop-flashlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrestaShopCorp%2Fprestashop-flashlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrestaShopCorp%2Fprestashop-flashlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PrestaShopCorp","download_url":"https://codeload.github.com/PrestaShopCorp/prestashop-flashlight/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234634977,"owners_count":18863978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arm64","docker","prestashop","testing"],"created_at":"2024-09-26T11:41:36.242Z","updated_at":"2025-09-29T15:30:57.337Z","avatar_url":"https://github.com/PrestaShopCorp.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"========\n\n## This repository has been moved to  https://github.com/PrestaShop/prestashop-flashlight\n\n========\n\n\n![PrestaShop Flashlight logo](./assets/prestashop_flashlight_logo.png)\n\nSpin a Prestashop testing instance in seconds!\n\n\u003e **⚠️ Disclaimer**: the following tool is provided in the solely purpose of bootstraping a PrestaShop testing environment. \u003cbr\u003eIf you look for a production grade image, please refer to https://github.com/PrestaShop/docker.\n\n\u003e **Note**: no MySQL server is shipped in the resulting image, you have to provide your own instance for the backup to be dumped during the first connection.\n\nCompatible with these architecture:\n\n- linux/amd64 (akka `x86_64`)\n- linux/arm64/v8 (akka `arm64`)\n\nThe resulting image is based on this tech stack:\n\n- An [Alpine](https://alpine-linux.org) linux image\n- An [Nginx](https://nginx.com) server\n\n## How fast is it?\n\nOn a Mac M1 (_linux/arm64_) computer:\n\n```\n❯ docker compose up -d\n[+] Building 0.0s (0/0)\n[+] Running 3/3\n ✔ Container phpmyadmin  Running            0.0s\n ✔ Container mysql       Healthy           10.8s\n ✔ Container prestashop  Started           11.1s\n```\n\nVS the official production image (_linux/amd64_ only) with `AUTO_INSTALL=1`: 2mn 15s.\n\n## Where do I find pre-built images?\n\nHere: https://hub.docker.com/r/prestashop/flashlight (please wait, will be soon available)\n\n## Build\n\nSimply:\n\n```sh\nPS_VERSION=8.1.0 ./build.sh\n```\n\nFor a custom multiplatform build \u0026 push:\n\n```sh\nPS_VERSION=8.1.0 \\\nPLATFORM=linux/amd64,linux/arm64 \\\nPUSH=true \\\nDOCKER_IMAGE=my-own-repo/testing:latest \\\n./build.sh\n```\n\n## Use\n\nStart the environment\n\n```sh\ncp .env.dist .env\nedit .env\ndocker compose up\n```\n\nAdd init scripts\n\n```yaml\nservices:\n  prestashop:\n    image: prestashop/flashlight:8.1.0-8.1\n    volumes:\n      - ./init-scripts:/tmp/init-scripts:ro\n```\n\n## Container environment variables\n\n- **`PS_DOMAIN`**\n  - Description: the public domain (and port) to reach your PrestaShop instance\n  - Mandatory if you do not use `NGROK_TUNNEL_AUTO_DETECT`\n  - Example: `localhost:8000`\n- **`NGROK_TUNNEL_AUTO_DETECT`**\n  - Description: the ngrok agent base API url, to guess the tunnel domain of your shop\n  - Mandatory if you do not use `PS_DOMAIN`\n  - Example: `http://ngrok:4040`\n- **`SSL_REDIRECT`**\n  - If set to `true` PrestaShop will be told to redirect all inbound traffic to https://$PS_DOMAIN\n  - Default to `false` (or automatically guessed if using NGROK_TUNNEL_AUTO_DETECT)\n- **`DEBUG_MODE`**\n  - If set to `true` the Debug mode will be enabled on PrestaShop\n  - Default to `false`\n- **`INSTALL_MODULES_DIR`**\n  - A module directory containing zips to be installed with the PrestaShop CLI\n  - Example: `/ps-modules`\n- **`INIT_ON_RESTART`**\n  - If set to `true` the PS_DOMAIN auto search and dump fix will be replayed on container restart\n  - Default to `false`\n- **`DUMP_ON_RESTART`**\n  - If set to `true` the dump restoration replayed on container restart\n  - Default to `false`\n- **`INSTALL_MODULES_ON_RESTART`**\n  - If set to `true` zip modules will be reinstalled on container restart\n  - Default to `false`\n- **`INIT_SCRIPTS_ON_RESTART`**\n  - If set to `true` custom init scripts will be replayed on container restart\n  - Default to `false`\n- **`ON_INIT_SCRIPT_FAILURE`**\n  - If set to `continue`, PrestaShop Flashlight will continue the boot process even if an init script failed\n  - Default to `fail`\n\n## Api calls within a docker network\n\n**Disclaimer**: PrestaShop is sensitive to the `Host` header of your client, and can behave surprisingly. In fact, since the Multi-shop feature is available, you cannot just call any front controller from any endpoint, unless... You set the ` Host` or the  `id_shop` you are targeting.\n\nLet's explain this subtle - rather mandatory - knowledge:\n\nAssume you have a module installed and working properly, and your PS_DOMAIN configured on `http://localhost:8000`\n\n```sh\n\u003e docker compose up -d\n\u003e curl -i 'http://localhost:8000/index.php?fc=module\u0026module=mymodule\u0026controller=myctrl'\nHTTP/1.1 200 OK\nsome happy content here ...\n```\n\nIs working as expected. But what about the same request performed within the docker container?\n\n```sh\n\u003e docker exec -t prestashop curl -i 'http://localhost:8000/index.php?fc=module\u0026module=mymodule\u0026controller=myctrl'\ncurl: (7) Failed to connect to localhost port 32000 after 5 ms: Couldn't connect to server\n```\n\nIndeed this **WON'T WORK**, the container port is 80, only the host know about 8000 in our use case. Let's talk to it:\n\n```sh\n\u003e docker exec -t prestashop curl -i 'http://localhost/index.php?fc=module\u0026module=mymodule\u0026controller=myctrl'\nHTTP/1.1 302 Found\nServer: nginx/1.24.0\nDate: Tue, 22 Aug 2023 08:53:22 GMT\nContent-Type: text/html; charset=utf-8\nTransfer-Encoding: chunked\nConnection: keep-alive\nX-Powered-By: PHP/8.1.22\nLocation: http://localhost:8000/\n```\n\nDamn! Do you know what's happening? PrestaShop cannot know which shop of its multi-shop configuration you are trying to talk to. Event with one shop, this won't be selected by default and fail with a redirect which cannot be resolved within our network configuration.\n\nIf you definitely know the Shop ID you are targeting, you can do this with success:\n\n```sh\ncurl -i -H  'http://localhost:80/index.php?id_shop=1\u0026fc=module\u0026module=mymodule\u0026controller=myctrl'\nHTTP/1.1 200 OK\nsome happy content here ...\n```\n\nbut the best way to perform this is to set the target `Host` in a header field:\n\n```sh\ncurl -i -H 'Host: localhost:8000' 'http://localhost:80/index.php?fc=module\u0026module=mymodule\u0026controller=myctrl'\nHTTP/1.1 302 Found\nServer: nginx/1.24.0\nDate: Tue, 22 Aug 2023 08:53:22 GMT\nContent-Type: text/html; charset=utf-8\nTransfer-Encoding: chunked\nConnection: keep-alive\nX-Powered-By: PHP/8.1.22\nLocation: http://localhost:8000/\n```\n\nor even better if you use an Nginx reverse-proxy to forward requests to prestashop within the internal docker network:\n\n```nginx\n# so you can call \"http://localhost:3000/prestashop/index.php\" to reach your PrestaShop id_shop 1 with success\nserver {\n  location /prestashop {\n      resolver 127.0.0.11 ipv6=off valid=10s;\n      resolver_timeout 10s;\n      proxy_set_header Host \"localhost:8000\";\n      rewrite /prestashop/?(.*) /$1 break;\n      set $frontend \"http://prestashop:80\";\n      proxy_pass $frontend;\n  }\n}\n```\n\n## Credits\n\n- https://github.com/PrestaShop/PrestaShop\n- https://github.com/PrestaShop/performance-project\n- https://github.com/jokesterfr/docker-prestashop\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprestashopcorp%2Fprestashop-flashlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprestashopcorp%2Fprestashop-flashlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprestashopcorp%2Fprestashop-flashlight/lists"}