1
- FROM occitech/magento:php7.0.0-apache
2
-
3
- # packages configuration
4
- RUN echo 'mysql-server mysql-server/root_password password P4ssw0rd' | debconf-set-selections
5
- RUN echo 'mysql-server mysql-server/root_password_again password P4ssw0rd' | debconf-set-selections
1
+ FROM occitech/magento:php7.0-apache
6
2
7
3
# packages/dependencies installation
8
- RUN systemctl mask mysql && apt-get update && apt-get install -y \
9
- mysql-client-5.5 \
4
+ RUN apt-get update && apt-get install -y \
10
5
mysql-server \
11
6
libxml2-dev \
12
7
git-core \
13
- wget && systemctl unmask mysql
8
+ wget
14
9
15
10
RUN docker-php-ext-install soap
16
11
RUN docker-php-ext-install mysqli
17
12
18
13
COPY bin/php.ini /usr/local/etc/php/php.ini
19
14
15
+ RUN sed -i -e 's/\/var\/www\/html/\/var\/www\/htdocs/' /etc/apache2/sites-enabled/000-default.conf
16
+
20
17
## download & install Magento
21
18
ARG MAGENTO_VERSION
22
19
@@ -31,20 +28,25 @@ RUN cd /var/www/htdocs/skin && cp -R /tmp/magento-sample-data-1.9.0.0/skin/* .
31
28
RUN chown -R www-data:www-data /var/www/htdocs
32
29
33
30
## database setup
34
- RUN find /var/lib/mysql -type f -exec touch {} \; && service mysql start && \
35
- (echo "CREATE DATABASE magento" | mysql -u root --password=P4ssw0rd) && \
36
- mysql -u root --password=P4ssw0rd magento < /tmp/magento-sample-data-1.9.0.0/magento_sample_data_for_1.9.0.0.sql && \
37
- MYSQL_HOST=127.0.0.1 MYSQL_USER=root MYSQL_PASSWORD=P4ssw0rd MYSQL_DATABASE=magento MAGENTO_LOCALE=en_US MAGENTO_TIMEZONE=Europe/Paris MAGENTO_DEFAULT_CURRENCY=USD MAGENTO_URL=http://mymagentostore.com MAGENTO_ADMIN_FIRSTNAME=Admin MAGENTO_ADMIN_LASTNAME=MyStore
[email protected] MAGENTO_ADMIN_USERNAME=admin MAGENTO_ADMIN_PASSWORD=magentorocks1 /usr/local/bin/install-magento && \
38
- service mysql stop
31
+ RUN service mysql start && \
32
+ mysql -u root -e "CREATE DATABASE magento;"
33
+
34
+ RUN service mysql start && \
35
+ mysql -u root -e "CREATE USER 'magento'@'localhost' IDENTIFIED BY 'P4ssw0rd'; GRANT ALL PRIVILEGES ON *.* TO 'magento'@'localhost'; FLUSH PRIVILEGES;"
36
+
37
+ RUN service mysql start && \
38
+ mysql -u root magento < /tmp/magento-sample-data-1.9.0.0/magento_sample_data_for_1.9.0.0.sql
39
+
40
+ RUN service mysql start && \
41
+ MYSQL_HOST=127.0.0.1 MYSQL_USER=magento MYSQL_PASSWORD=P4ssw0rd MYSQL_DATABASE=magento MAGENTO_LOCALE=en_US MAGENTO_TIMEZONE=Europe/Paris MAGENTO_DEFAULT_CURRENCY=USD MAGENTO_URL=http://mymagentostore.com MAGENTO_ADMIN_FIRSTNAME=Admin MAGENTO_ADMIN_LASTNAME=MyStore
[email protected] MAGENTO_ADMIN_USERNAME=admin MAGENTO_ADMIN_PASSWORD=magentorocks1 /usr/local/bin/install-magento
39
42
40
43
## configure Magento
41
- RUN find /var/lib/mysql -type f -exec touch {} \; && service mysql start && \
44
+ RUN service mysql start && \
42
45
n98-magerun --skip-root-check --root-dir=/var/www/htdocs cache:flush && \
43
46
n98-magerun --skip-root-check --root-dir=/var/www/htdocs cache:disable && \
44
47
n98-magerun --skip-root-check --root-dir=/var/www/htdocs config:set dev/template/allow_symlink "1" >/dev/null 2>&1 && \
45
48
n98-magerun --skip-root-check --root-dir=/var/www/htdocs admin:notifications >/dev/null 2>&1 && \
46
- n98-magerun --skip-root-check --root-dir=/var/www/htdocs config:set admin/security/use_form_key "0" >/dev/null 2>&1 && \
47
- service mysql stop
49
+ n98-magerun --skip-root-check --root-dir=/var/www/htdocs config:set admin/security/use_form_key "0" >/dev/null 2>&1
48
50
49
51
# algoliasearch-magento setup
50
52
RUN cd /tmp && curl -s -L -O https://raw.github.com/colinmollenhour/modman/master/modman-installer && chmod +x modman-installer && ./modman-installer
0 commit comments