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 #139 from PrestaShop/add-missing-releases
Add missing releases
- Loading branch information
Showing
32 changed files
with
2,256 additions
and
40 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,50 @@ | ||
FROM alterway/php:5.3-apache | ||
LABEL maintainer="Thomas Nabord <thomas.nabord@prestashop.com>" | ||
|
||
ENV PS_DOMAIN="<to be defined>" \ | ||
DB_SERVER="<to be defined>" \ | ||
DB_PORT=3306 \ | ||
DB_NAME=prestashop \ | ||
DB_USER=root \ | ||
DB_PASSWD=admin \ | ||
DB_PREFIX=ps_ \ | ||
ADMIN_MAIL=demo@prestashop.com \ | ||
ADMIN_PASSWD=prestashop_demo \ | ||
PS_LANGUAGE=en \ | ||
PS_COUNTRY=GB \ | ||
PS_INSTALL_AUTO=0 \ | ||
PS_ERASE_DB=0 \ | ||
PS_DEV_MODE=0 \ | ||
PS_HOST_MODE=0 \ | ||
PS_HANDLE_DYNAMIC_DOMAIN=0 \ | ||
PS_FOLDER_ADMIN=admin \ | ||
PS_FOLDER_INSTALL=install | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y libmcrypt-dev \ | ||
libpcre3-dev \ | ||
libpng-dev \ | ||
libfreetype6-dev \ | ||
libxml2-dev \ | ||
libicu-dev \ | ||
mysql-client \ | ||
wget \ | ||
unzip \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ | ||
&& docker-php-ext-install iconv intl pdo_mysql mbstring soap gd zip mysql mcrypt | ||
|
||
# Prepare install and CMD script | ||
COPY config_files/ps-extractor.sh config_files/docker_run.sh /tmp/ | ||
|
||
# If handle dynamic domain | ||
COPY config_files/docker_updt_ps_domains.php /tmp/ | ||
|
||
# Apache configuration | ||
RUN if [ -x "$(command -v apache2-foreground)" ]; then a2enmod rewrite; fi | ||
|
||
# PHP configuration | ||
COPY config_files/php.ini /usr/local/etc/php/ | ||
|
||
# Run | ||
CMD ["/tmp/docker_run.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,82 @@ | ||
#!/bin/sh | ||
|
||
if [ "$DB_SERVER" = "<to be defined>" -a $PS_INSTALL_AUTO = 1 ]; then | ||
echo >&2 'error: You requested automatic PrestaShop installation but MySQL server address is not provided ' | ||
echo >&2 ' You need to specify DB_SERVER in order to proceed' | ||
exit 1 | ||
fi | ||
|
||
if [ ! -f ./config/settings.inc.php ]; then | ||
echo "\n* Reapplying PrestaShop files for enabled volumes ..."; | ||
|
||
# init if empty | ||
cp -n -R -p /tmp/data-ps/prestashop/* /var/www/html | ||
|
||
if [ $PS_DEV_MODE -ne 0 ]; then | ||
echo "\n* Enabling DEV mode ..."; | ||
sed -ie "s/define('_PS_MODE_DEV_', false);/define('_PS_MODE_DEV_',\ true);/g" /var/www/html/config/defines.inc.php | ||
fi | ||
|
||
if [ $PS_HOST_MODE -ne 0 ]; then | ||
echo "\n* Enabling HOST mode ..."; | ||
echo "define('_PS_HOST_MODE_', true);" >> /var/www/html/config/defines.inc.php | ||
fi | ||
|
||
if [ $PS_FOLDER_INSTALL != "install" ]; then | ||
echo "\n* Renaming install folder as $PS_FOLDER_INSTALL ..."; | ||
mv /var/www/html/install /var/www/html/$PS_FOLDER_INSTALL/ | ||
fi | ||
|
||
if [ $PS_FOLDER_ADMIN != "admin" ]; then | ||
echo "\n* Renaming admin folder as $PS_FOLDER_ADMIN ..."; | ||
mv /var/www/html/admin /var/www/html/$PS_FOLDER_ADMIN/ | ||
fi | ||
|
||
if [ $PS_HANDLE_DYNAMIC_DOMAIN = 1 ]; then | ||
cp /tmp/docker_updt_ps_domains.php /var/www/html | ||
sed -ie "s/DirectoryIndex\ index.php\ index.html/DirectoryIndex\ docker_updt_ps_domains.php\ index.php\ index.html/g" $APACHE_CONFDIR/conf-available/docker-php.conf | ||
fi | ||
|
||
if [ $PS_INSTALL_AUTO = 1 ]; then | ||
RET=1 | ||
while [ $RET -ne 0 ]; do | ||
mysql -h $DB_SERVER -P $DB_PORT -u $DB_USER -p$DB_PASSWD -e "status" > /dev/null 2>&1 | ||
RET=$? | ||
if [ $RET -ne 0 ]; then | ||
echo "\n* Waiting for confirmation of MySQL service startup"; | ||
sleep 5 | ||
fi | ||
done | ||
|
||
echo "\n* Installing PrestaShop, this may take a while ..."; | ||
if [ $PS_ERASE_DB = 1 ]; then | ||
echo "\n* Drop & recreate mysql database..."; | ||
if [ $DB_PASSWD = "" ]; then | ||
mysqladmin -h $DB_SERVER -P $DB_PORT -u $DB_USER drop $DB_NAME --force 2> /dev/null; | ||
mysqladmin -h $DB_SERVER -P $DB_PORT -u $DB_USER create $DB_NAME --force 2> /dev/null; | ||
else | ||
mysqladmin -h $DB_SERVER -P $DB_PORT -u $DB_USER -p$DB_PASSWD drop $DB_NAME --force 2> /dev/null; | ||
mysqladmin -h $DB_SERVER -P $DB_PORT -u $DB_USER -p$DB_PASSWD create $DB_NAME --force 2> /dev/null; | ||
fi | ||
fi | ||
|
||
if [ "$PS_DOMAIN" = "<to be defined>" ]; then | ||
export PS_DOMAIN=$(hostname -i) | ||
fi | ||
|
||
runuser -g www-data -u www-data -- php /var/www/html/$PS_FOLDER_INSTALL/index_cli.php \ | ||
--domain="$PS_DOMAIN" --db_server=$DB_SERVER:$DB_PORT --db_name="$DB_NAME" --db_user=$DB_USER \ | ||
--db_password=$DB_PASSWD --prefix="$DB_PREFIX" --firstname="John" --lastname="Doe" \ | ||
--password=$ADMIN_PASSWD --email="$ADMIN_MAIL" --language=$PS_LANGUAGE --country=$PS_COUNTRY \ | ||
--newsletter=0 --send_email=0 | ||
|
||
if [ $? -ne 0 ]; then | ||
echo 'warning: PrestaShop installation failed.' | ||
fi | ||
fi | ||
else | ||
echo "\n* Pretashop Core already installed..."; | ||
fi | ||
|
||
echo "\n* Almost ! Starting web server now\n"; | ||
exec apache2-foreground |
57 changes: 57 additions & 0 deletions
57
base/images/5.3-apache/config_files/docker_updt_ps_domains.php
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,57 @@ | ||
<?php | ||
/** | ||
* 2007-2016 PrestaShop | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Academic Free License (AFL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/afl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to license@prestashop.com so we can send you a copy immediately. | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer | ||
* versions in the future. If you wish to customize PrestaShop for your | ||
* needs please refer to http://www.prestashop.com for more information. | ||
* | ||
* @author PrestaShop SA <contact@prestashop.com> | ||
* @copyright 2007-2016 PrestaShop SA | ||
* @version Release: $Revision: 14390 $ | ||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) | ||
* International Registered Trademark & Property of PrestaShop SA | ||
*/ | ||
|
||
// Workaround for redirection on init | ||
$_POST['id_shop'] = 1; | ||
|
||
require_once 'config/config.inc.php'; | ||
|
||
if (!defined('_PS_VERSION_')) | ||
exit; | ||
|
||
// First, we get the URL used to reach this page. | ||
$domain = Tools::getHttpHost(); | ||
$old_domain = Configuration::get('PS_SHOP_DOMAIN'); | ||
|
||
if (version_compare(_PS_VERSION_, '1.5', '>=') && $domain != $old_domain && !Shop::isFeatureActive()) | ||
{ | ||
$url = ShopUrl::getShopUrls(Configuration::get('PS_SHOP_DEFAULT'))->where('main', '=', 1)->getFirst(); | ||
if ($url) | ||
{ | ||
$url->domain = $domain; | ||
$url->domain_ssl = $domain; | ||
$url->save(); | ||
|
||
// Then, we update the configuration table | ||
Configuration::updateValue('PS_SHOP_DOMAIN', $domain); | ||
Configuration::updateValue('PS_SHOP_DOMAIN_SSL', $domain); | ||
} | ||
} | ||
|
||
//unlink(__FILE__); | ||
Tools::redirect("index.php"); | ||
die(); |
Oops, something went wrong.