Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ DOCKER_NGROK_VERSION=alpine
DOCKER_PRESTASHOP_VERSION=8.0.0
NGROK_TOKEN=xxxxxxx
EXT_PORT_PHPMYADMIN=8888
EXT_PORT_PRESTASHOP=8000
EXT_PORT_PRESTASHOP=8000
EXT_PORT_NGROK=4040
DOCKER_NETWORK_NAME=ps_network
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.env*
!.env.dist
!.env.dist
.idea
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ services:
aliases:
- ngrok
ports:
- 4040:4040
- ${EXT_PORT_NGROK:-4040}:4040

prestashop-mysql:
image: mariadb:${DOCKER_MARIADB_VERSION:-10.8}
Expand Down Expand Up @@ -81,6 +81,7 @@ services:

networks:
prestashop:
name: ${DOCKER_NETWORK_NAME:-ps_network}

volumes:
ps-modules:
Expand Down
1 change: 1 addition & 0 deletions ngrok/ngrok.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ tunnels:
inspect: true
schemes:
- https
# hostname: coherent-spider-cute.ngrok-free.app
1 change: 1 addition & 0 deletions prestashop/prestashop.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ PS_INSTALL_AUTO=1
PS_ERASE_DB=1
PS_INSTALL_DB=1
PS_ENABLE_SSL=1
PS_DEV_MODE=1
PS_FOLDER_INSTALL=install
PS_FOLDER_ADMIN=ps-admin
[email protected]
Expand Down
4 changes: 3 additions & 1 deletion prestashop/ps_scripts/docker_startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export MODULE_DIR="${MODULE_DIR:-/var/www/html/modules}"

# POST-INSTALL scripts
mkdir -p /tmp/init-scripts/
cp ./install_modules.sh /tmp/init-scripts/1-install_modules.sh
cp ./init-scripts/activate_debug_mode.sh /tmp/init-scripts/1-activate_debug_mode.sh
cp ./init-scripts/install_modules.sh /tmp/init-scripts/2-install_modules.sh
chmod +x /tmp/init-scripts/*.sh

# Assert the ownership
chown -R www-data:www-data ${PS_DIR}
Expand Down
9 changes: 9 additions & 0 deletions prestashop/ps_scripts/init-scripts/activate_debug_mode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

if [ $PS_DEV_MODE -ne 0 ]; then
echo "Post script: Activating debug mode..."
sed -i "s/define('_PS_MODE_DEV_', false);/define('_PS_MODE_DEV_', true);/" /var/www/html/config/defines.inc.php
# PS docker image has problem parsing this file, remove it to be able to toggle debug mode in Admin UI
rm -f /var/www/html/config/defines_custom.inc.php
fi
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@ set -e
INSTALL_COMMAND="${PS_DIR}/bin/console prestashop:module --no-interaction install"
MODULES_TO_INSTALL=/ps-modules

for file in $(ls "${MODULES_TO_INSTALL}/*.zip"); do
module=$(basename ${file} | tr "-" "\n" | head -n 1);
get_module_name() {
local zip_file="$1"
local module_name=$(unzip -l "$zip_file" | awk 'NR==4{print $4}' | xargs basename)

echo "$module_name"
}

for file in $(ls "${MODULES_TO_INSTALL}"/*.zip); do
module=$(get_module_name $file)
echo "--> installing ${module} from ${file}...";
rm -rf "${MODULE_DIR}/${module:-something-at-least}"
unzip -qq ${file} -d ${MODULE_DIR}
php $INSTALL_COMMAND ${module}
done;

# If there is module to install after init PS, the files under `var/log` or `var/cache` will be under root
echo "--> Recover the PS dir ownership"
chown -R www-data:www-data ${PS_DIR}
2 changes: 2 additions & 0 deletions ps-modules/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!README.md