This repository has been archived by the owner on Jan 2, 2023. It is now read-only.
forked from alexcheng1982/docker-magento2
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.hbs
60 lines (45 loc) · 2.01 KB
/
Dockerfile.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM quay.io/alexcheng1982/apache2-php7:{{phpVersion}}
LABEL maintainer="alexcheng1982@gmail.com"
LABEL php_version="{{phpVersion}}"
LABEL magento_version="{{magento2Version}}"
LABEL description="Magento {{magento2Version}} with PHP {{phpVersion}}"
ENV MAGENTO_VERSION {{magento2Version}}
ENV INSTALL_DIR /var/www/html
ENV COMPOSER_HOME /var/www/.composer/
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer
COPY ./auth.json $COMPOSER_HOME
RUN requirements="libpng++-dev libzip-dev libmcrypt-dev libmcrypt4 libcurl3-dev libfreetype6 libjpeg-turbo8 libjpeg-turbo8-dev libfreetype6-dev libicu-dev libxslt1-dev unzip" \
&& apt-get update \
&& apt-get install -y $requirements \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install pdo_mysql \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install gd \
&& docker-php-ext-install mbstring \
&& docker-php-ext-install zip \
&& docker-php-ext-install intl \
&& docker-php-ext-install xsl \
&& docker-php-ext-install soap \
&& docker-php-ext-install bcmath
RUN yes '' | pecl install mcrypt-1.0.3 \
&& echo 'extension=mcrypt.so' > /usr/local/etc/php/conf.d/mcrypt.ini
RUN chsh -s /bin/bash www-data
{{{magento2Installation}}}
RUN cd $INSTALL_DIR \
&& find . -type d -exec chmod 770 {} \; \
&& find . -type f -exec chmod 660 {} \; \
&& chmod u+x bin/magento
COPY ./install-magento /usr/local/bin/install-magento
RUN chmod +x /usr/local/bin/install-magento
COPY ./install-sampledata /usr/local/bin/install-sampledata
RUN chmod +x /usr/local/bin/install-sampledata
RUN a2enmod rewrite
RUN echo "memory_limit=2048M" > /usr/local/etc/php/conf.d/memory-limit.ini
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR $INSTALL_DIR
# Add cron job
ADD crontab /etc/cron.d/magento2-cron
RUN chmod 0644 /etc/cron.d/magento2-cron \
&& crontab -u www-data /etc/cron.d/magento2-cron
VOLUME $INSTALL_DIR