Skip to content

Commit 4fec317

Browse files
committed
Merge branch 'master' of github.com:alankent/docker-magento2-demo-apache
Conflicts: README.md build.sh config/composer.json
2 parents baa6e16 + 5878ff6 commit 4fec317

File tree

3 files changed

+35
-38
lines changed

3 files changed

+35
-38
lines changed

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ To run the default 'mysql' container, please name the container 'mysql'
1717
and expose port 3306 for the Magento 2 container to use. For the purpose
1818
of this demo, set the 'root' account password to 'admin'.
1919

20-
docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=admin mysql
20+
docker run -d --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=admin \
21+
mysql:5.6
22+
23+
Do check that it started up (the -d makes it run as a daemon in
24+
background) use
25+
26+
docker logs mysql
2127

2228
An interestiong experiment for the reader is to replace the 'mysql'
2329
container with a Maria DB instance.
@@ -28,7 +34,7 @@ several additional environment variables.
2834
docker run --rm --name magento2 -p 80:80 --link mysql:mysql \
2935
-e MYSQL_USER=root -e MYSQL_PASSWORD=admin \
3036
-e PUBLIC_HOST=yourhost.example.com \
31-
docker-magento2-demo-apache $*
37+
alankent/docker-magento2-demo-apache:0.42.0-beta6
3238

3339
When this container is started, it loops waiting for a succesful
3440
connection to the MySQL database. Once achieved it runs a PHP script

scripts/install-magento2

+4-12
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,10 @@ rm -rf htdocs
88
mkdir -p htdocs
99

1010
curl -sS https://getcomposer.org/installer | php
11-
php composer.phar install --profile
11+
php composer.phar install
1212

13-
cd htdocs
14-
php -f dev/tools/Magento/Tools/View/deploy.php
15-
php -f dev/tools/Magento/Tools/Di/compiler.php
16-
17-
# Use developer mode to get more detailed error diagnostics, at least for now.
18-
echo "SetEnv MAGE_MODE developer" >> .htaccess
19-
#echo "SetEnv MAGE_MODE production" >> .htaccess
20-
21-
# Setup script is independent to main site - set it up too.
22-
cd setup
23-
COMPOSER_PROCESS_TIMEOUT=1000 php ../../composer.phar install --profile
13+
# Swap to developer mode for better error diagnostics
14+
echo "SetEnv MAGE_MODE production" >> .htaccess
15+
#echo "SetEnv MAGE_MODE developer" >> .htaccess
2416

2517
chown www-data:www-data -R /var/www/magento2

scripts/runserver

+23-24
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,30 @@ until mysql $MYSQLAUTH -e ""; do
1212
sleep 1
1313
done
1414

15-
mysql $MYSQLAUTH -e "CREATE DATABASE IF NOT EXISTS magento2"
15+
mysql $MYSQLAUTH -e "CREATE DATABASE IF NOT EXISTS magento"
1616

17-
# Create the Magento local.xml file
18-
if [ ! -f /var/www/magento2/htdocs/app/etc/local.xml ]; then
19-
(
20-
cd /var/www/magento2/htdocs/setup
21-
php -f index.php install \
22-
--cleanup_database \
23-
--db_host=mysql \
24-
--db_name=magento2 \
25-
--db_user="$MYSQL_USER" \
26-
--db_pass="$MYSQL_PASSWORD" \
27-
--backend_frontname=admin \
28-
--base_url=http://$PUBLIC_HOST/ \
29-
--language=en_US \
30-
--timezone=America/Los_Angeles \
31-
--currency=USD \
32-
--admin_lastname=Smith \
33-
--admin_firstname=John \
34-
35-
--admin_username=admin \
36-
--admin_password=admin123 \
37-
--use_secure=0
38-
)
39-
fi
17+
cd /var/www/magento2/htdocs
18+
php -f setup/index.php install \
19+
--cleanup_database \
20+
--db_host=mysql \
21+
--db_name=magento \
22+
--db_user="$MYSQL_USER" \
23+
--db_pass="$MYSQL_PASSWORD" \
24+
--backend_frontname=admin \
25+
--base_url=http://$PUBLIC_HOST/ \
26+
--language=en_US \
27+
--timezone=America/Los_Angeles \
28+
--currency=USD \
29+
--admin_lastname=Smith \
30+
--admin_firstname=John \
31+
32+
--admin_username=admin \
33+
--admin_password=admin123 \
34+
--use_secure=0
35+
36+
# In production mode we pre-compute various files
37+
php -f dev/tools/Magento/Tools/View/deploy.php
38+
php -f dev/tools/Magento/Tools/Di/compiler.php
4039

4140
# Run the web server
4241
exec /usr/sbin/apache2 -D FOREGROUND

0 commit comments

Comments
 (0)