-
-
Notifications
You must be signed in to change notification settings - Fork 257
/
Dockerfile.hbs
62 lines (46 loc) · 2.22 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
61
62
FROM {{baseImage}}:{{phpVersion}}
LABEL maintainer="alexcheng1982@gmail.com"
LABEL php_version="{{phpVersion}}"
LABEL magento_version="{{magento2Version}}"
LABEL description="Magento Open Source {{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 {{composerInstallArgs}}\
&& 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 zip unzip libxml2 libonig-dev" \
set -eux; \
apt-get update; \
apt-get install -y $requirements; \
rm -rf /var/lib/apt/lists/*
RUN set -eux; \
docker-php-ext-install pdo_mysql; \
docker-php-ext-configure gd --with-freetype --with-jpeg; \
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 sockets; \
docker-php-ext-install bcmath
RUN yes '' | pecl install mcrypt-1.0.6 \
&& echo 'extension=mcrypt.so' > /usr/local/etc/php/conf.d/mcrypt.ini
RUN chsh -s /bin/bash www-data
RUN chown -R www-data:www-data /var/www
RUN su www-data -c "COMPOSER_MEMORY_LIMIT=-1 composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition $INSTALL_DIR $MAGENTO_VERSION"
RUN cd $INSTALL_DIR \
&& find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} + \
&& find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} + \
&& chown -R :www-data . \
&& 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
VOLUME $INSTALL_DIR