Skip to content

Commit 0840bc3

Browse files
author
Jan Petr
authored
Fix Dockerfile (#1120)
1 parent 7e9dce1 commit 0840bc3

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

dev/Dockerfile.base

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
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
62

73
# 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 \
105
mysql-server \
116
libxml2-dev \
127
git-core \
13-
wget && systemctl unmask mysql
8+
wget
149

1510
RUN docker-php-ext-install soap
1611
RUN docker-php-ext-install mysqli
1712

1813
COPY bin/php.ini /usr/local/etc/php/php.ini
1914

15+
RUN sed -i -e 's/\/var\/www\/html/\/var\/www\/htdocs/' /etc/apache2/sites-enabled/000-default.conf
16+
2017
## download & install Magento
2118
ARG MAGENTO_VERSION
2219

@@ -31,20 +28,25 @@ RUN cd /var/www/htdocs/skin && cp -R /tmp/magento-sample-data-1.9.0.0/skin/* .
3128
RUN chown -R www-data:www-data /var/www/htdocs
3229

3330
## 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
3942

4043
## configure Magento
41-
RUN find /var/lib/mysql -type f -exec touch {} \; && service mysql start && \
44+
RUN service mysql start && \
4245
n98-magerun --skip-root-check --root-dir=/var/www/htdocs cache:flush && \
4346
n98-magerun --skip-root-check --root-dir=/var/www/htdocs cache:disable && \
4447
n98-magerun --skip-root-check --root-dir=/var/www/htdocs config:set dev/template/allow_symlink "1" >/dev/null 2>&1 && \
4548
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
4850

4951
# algoliasearch-magento setup
5052
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

Comments
 (0)