Skip to content

Commit ef1d0f4

Browse files
author
Alan Kent
committed
2 parents 96b6f6e + 678a831 commit ef1d0f4

File tree

7 files changed

+44
-24
lines changed

7 files changed

+44
-24
lines changed

Diff for: Dockerfile

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ RUN apt-get update && apt-get install -y apache2 mysql-client php5 php5-curl php
66

77
# mcrypt.ini appears to be missing from apt-get install. Needed for PHP mcrypt library to be enabled.
88
ADD config/20-mcrypt.ini /etc/php5/cli/conf.d/20-mcrypt.ini
9+
ADD config/20-mcrypt.ini /etc/php5/apache2/conf.d/20-mcrypt.ini
910

1011
# Environment variables from /etc/apache2/apache2.conf
1112
ENV APACHE_RUN_USER www-data
@@ -19,7 +20,8 @@ ENV APACHE_PID_FILE /var/run/apache2/apache2.pid
1920
RUN a2enmod rewrite
2021

2122
# Add the Apache virtual host file
22-
ADD config/apache_default_vhost /etc/apache2/sites-available/default
23+
ADD config/apache_default_vhost /etc/apache2/sites-enabled/magento2.conf
24+
RUN rm -f /etc/apache2/sites-enabled/000-default.conf
2325

2426
# Add the MySQL client configuration file (no server settings)
2527
ADD config/my.cnf /etc/mysql/my.cnf
@@ -53,4 +55,6 @@ EXPOSE 80
5355

5456
# Start up the Apache server
5557
ADD scripts/runserver /usr/local/bin/runserver
56-
ENTRYPOINT ["/usr/local/bin/runserver"]
58+
RUN chmod +x /usr/local/bin/runserver
59+
ENTRYPOINT ["bash", "-c"]
60+
CMD ["/usr/local/bin/runserver"]

Diff for: build.sh

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
#!/bin/bash
22

33
docker build -t docker-magento2-demo-apache .
4+
5+
echo To publish use:
6+
echo docker tag docker-magento2-demo-apache alankent/docker-magento2-demo-apache
7+
echo docker tag docker-magento2-demo-apache alankent/docker-magento2-demo-apache:0.1.0-alpha89
8+
echo docker push alankent/docker-magento2-demo-apache
9+
echo docker push alankent/docker-magento2-demo-apache:0.1.0-alpha89

Diff for: config/apache_default_vhost

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
DocumentRoot /var/www/magento2/htdocs
44

55
<Directory /var/www/magento2/htdocs>
6-
Options Indexes FollowSymLinks -MultiViews
6+
Options Indexes FollowSymLinks
77
AllowOverride All
88
Order allow,deny
99
allow from all

Diff for: run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
docker run --name magento2 -i -t -p 80:80 --link mysql:mysql docker-magento2-demo-apache bash
1+
docker run --rm --name magento2 -i -t -p 80:80 --link mysql:mysql -e MYSQL_USER=root -e MYSQL_PASSWORD=admin -e PUBLIC_HOST=coreos-1-5920.lvs01.dev.ebayc3.com docker-magento2-demo-apache $*

Diff for: scripts/create-database

-3
This file was deleted.

Diff for: scripts/install-magento2

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ cd htdocs
1414
php -f dev/tools/Magento/Tools/View/deploy.php
1515
php -f dev/tools/Magento/Tools/Di/compiler.php
1616

17-
echo "SetEnv MAGE_MODE production" >> .htaccess
17+
#echo "SetEnv MAGE_MODE production" >> .htaccess
18+
echo "SetEnv MAGE_MODE developer" >> .htaccess
1819

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

Diff for: scripts/runserver

+28-16
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#!/bin/bash
22

3+
# Show what we execute
4+
set -x
5+
36
# MySQL authentication
4-
MYSQLAUTH="--user=\"$MYSQL_USER\" --password=\"$MYSQL_PASSWORD\""
7+
MYSQLAUTH="--user=$MYSQL_USER --password=$MYSQL_PASSWORD"
58

69
# Wait for MySQL to come up.
710
until mysql $MYSQLAUTH -e ""; do
@@ -13,20 +16,29 @@ done
1316
mysql $MYSQLAUTH -e "CREATE DATABASE IF NOT EXISTS magento2;"
1417

1518
# Create the Magento local.xml file
16-
sed < /var/www/magento2/htdocs/app/etc/local.xml.template \
17-
-e "s/{{date}}/<![CDATA[`date`]]>/" \
18-
-e "s/{{key}}/bfabadc79e44be389494390b63c42114/" \
19-
-e "s/{{db_prefix}}//" \
20-
-e "s/{{db_host}}/mysql/" \
21-
-e "s/{{db_user}}/$MYSQL_USER/" \
22-
-e "s/{{db_pass}}/$MYSQL_PASSWORD/" \
23-
-e "s/{{db_name}}/magento2/" \
24-
-e "s/{{db_init_statements}}/SET NAMES utf8/" \
25-
-e "s/{{db_model}}/mysql4/" \
26-
-e "s/{{session_save}}/files/" \
27-
-e "s/{{backend_frontname}}/backend/" \
28-
> /var/www/magento2/htdocs/app/etc/local.xml
19+
if [ ! -f /var/www/magento2/htdocs/app/etc/local.xml ]; then
20+
php -f /var/www/magento2/htdocs/dev/shell/install.php -- \
21+
--license_agreement_accepted yes \
22+
--locale en_US \
23+
--timezone "America/Los_Angeles" \
24+
--default_currency USD \
25+
--db_host mysql \
26+
--db_name magento2 \
27+
--db_user "$MYSQL_USER" \
28+
--db_pass "$MYSQL_PASSWORD" \
29+
--url "http://$PUBLIC_HOST/" \
30+
--use_rewrites no \
31+
--use_secure_admin yes \
32+
--admin_lastname Smith \
33+
--admin_firstname John \
34+
--admin_email "[email protected]" \
35+
--admin_username admin \
36+
--admin_password admin123 \
37+
--use_secure no \
38+
--secure_base_url "https://$PUBLIC_HOST/" \
39+
--skip_url_validation \
40+
--cleanup_database
41+
fi
2942

3043
# Run the web server
31-
echo exec /usr/sbin/apache2 -D FOREGROUND
32-
bash
44+
exec /usr/sbin/apache2 -D FOREGROUND

0 commit comments

Comments
 (0)