-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.common
32 lines (27 loc) · 1.29 KB
/
Dockerfile.common
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
ARG COMPOSER_AUTH
CMD ["/magento.sh"]
RUN sudo apt-get update \
&& sudo rm -Rf /etc/php/$PHP_VERSION/cli \
&& sudo apt-get install --no-install-recommends --yes \
imagemagick \
sassc \
php${PHP_VERSION}-gd \
php${PHP_VERSION}-imagick \
&& sudo rm -Rf /etc/php/$PHP_VERSION/cli \
&& sudo ln -s /etc/php/$PHP_VERSION/fpm /etc/php/$PHP_VERSION/cli \
&& sudo rm -rf /var/lib/apt/lists/*
COPY . /
ENV MAGENTO_VERSION=${MAGENTO_VERSION} \
NGINX_CONF=magento \
ENABLE_REDIS=On \
PHP_OPCACHE_VALIDATE=Off
RUN composer create-project --no-interaction --prefer-dist --no-dev --repository=https://repo.magento.com/ magento/project-community-edition ${WEB_ROOT} ${MAGENTO_VERSION} && \
composer clear-cache && \
sed -i '/^#/d' ${WEB_ROOT}/nginx.conf.sample && \
sed -i '/memory_limit/d' ${WEB_ROOT}/nginx.conf.sample && \
sed -i 's/|health_check/|health_check|search/g' ${WEB_ROOT}/nginx.conf.sample && \
sed -i 's/php-fpm:9000/fastcgi_backend/g' ${WEB_ROOT}/nginx.conf.sample && \
sed -i "/fastcgi_backend/a \
fastcgi_param MAGE_MODE \$MAGE_MODE if_not_empty; \
fastcgi_param MAGE_RUN_CODE \$MAGE_RUN_CODE if_not_empty;" ${WEB_ROOT}/nginx.conf.sample && \
sudo cp ${WEB_ROOT}/nginx.conf.sample /templates/magento.conf.j2