forked from clean-docker/Magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·125 lines (99 loc) · 3.44 KB
/
Dockerfile
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
FROM php:7.1-apache
MAINTAINER Rafael Corrêa Gomes <[email protected]>
ENV XDEBUG_PORT 9000
# Install System Dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
software-properties-common \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
libfreetype6-dev \
libicu-dev \
libssl-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libedit-dev \
libedit2 \
libxslt1-dev \
apt-utils \
gnupg \
redis-tools \
mysql-client \
git \
vim \
wget \
curl \
lynx \
psmisc \
unzip \
tar \
cron \
bash-completion \
&& apt-get clean
# Install Magento Dependencies
RUN docker-php-ext-configure \
gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/; \
docker-php-ext-install \
opcache \
gd \
bcmath \
intl \
mbstring \
mcrypt \
pdo_mysql \
soap \
xsl \
zip
# Install oAuth
RUN apt-get update \
&& apt-get install -y \
libpcre3 \
libpcre3-dev \
# php-pear \
&& pecl install oauth \
&& echo "extension=oauth.so" > /usr/local/etc/php/conf.d/docker-php-ext-oauth.ini
# Install Node, NVM, NPM and Grunt
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
&& apt-get install -y nodejs build-essential \
&& curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh \
&& npm i -g grunt-cli yarn
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer
RUN composer global require hirak/prestissimo
# Install Code Sniffer
RUN git clone https://github.com/magento/marketplace-eqp.git ~/.composer/vendor/magento/marketplace-eqp
RUN cd ~/.composer/vendor/magento/marketplace-eqp && composer install
RUN ln -s ~/.composer/vendor/magento/marketplace-eqp/vendor/bin/phpcs /usr/local/bin;
ENV PATH="/var/www/.composer/vendor/bin/:${PATH}"
# Install XDebug
RUN yes | pecl install xdebug && \
echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.iniOLD
# Install Mhsendmail
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install golang-go \
&& mkdir /opt/go \
&& export GOPATH=/opt/go \
&& go get github.com/mailhog/mhsendmail
# Install Magerun 2
RUN wget https://files.magerun.net/n98-magerun2.phar \
&& chmod +x ./n98-magerun2.phar \
&& mv ./n98-magerun2.phar /usr/local/bin/
# Configuring system
ADD .docker/config/php.ini /usr/local/etc/php/php.ini
ADD .docker/config/magento.conf /etc/apache2/sites-available/magento.conf
ADD .docker/config/custom-xdebug.ini /usr/local/etc/php/conf.d/custom-xdebug.ini
COPY .docker/bin/* /usr/local/bin/
COPY .docker/users/* /var/www/
RUN chmod +x /usr/local/bin/*
RUN ln -s /etc/apache2/sites-available/magento.conf /etc/apache2/sites-enabled/magento.conf
RUN curl -o /etc/bash_completion.d/m2install-bash-completion https://raw.githubusercontent.com/yvoronoy/m2install/master/m2install-bash-completion
RUN curl -o /etc/bash_completion.d/n98-magerun2.phar.bash https://raw.githubusercontent.com/netz98/n98-magerun2/master/res/autocompletion/bash/n98-magerun2.phar.bash
RUN echo "source /etc/bash_completion" >> /root/.bashrc
RUN echo "source /etc/bash_completion" >> /var/www/.bashrc
RUN chmod 777 -Rf /var/www /var/www/.* \
&& chown -Rf www-data:www-data /var/www /var/www/.* \
&& usermod -u 1000 www-data \
&& chsh -s /bin/bash www-data\
&& a2enmod rewrite \
&& a2enmod headers
VOLUME /var/www/html
WORKDIR /var/www/html