-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
111 lines (98 loc) · 3.05 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
FROM ubuntu:16.04
MAINTAINER "[email protected]" Artem Aleksashkin
# BASE
RUN \
DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends\
ca-certificates\
apt-utils\
apt-transport-https\
locales\
language-pack-ru-base\
tzdata\
cron\
wget\
&& \
usermod -u 1000 www-data && \
groupmod -g 1000 www-data && \
mkdir -p /var/www/html && \
mkdir -p /var/www/data && \
mkdir -p -m 777 /tmp/project && \
chown -R www-data:www-data /var/www &&\
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen &&\
echo "en_GB.UTF-8 UTF-8" >> /etc/locale.gen &&\
echo "ru_RU.UTF-8 UTF-8" >> /etc/locale.gen &&\
echo "ru_RU.CP1251 CP1251" >> /etc/locale.gen &&\
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure -f noninteractive locales &&\
ln -snf /usr/share/zoneinfo/Europe/Moscow /etc/localtime &&\
echo "Europe/Moscow" > /etc/timezone &&\
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure -f noninteractive tzdata &&\
rm -rf /var/lib/apt/lists/*
ENV LANG "ru_RU.UTF-8"
ENV LANGUAGE "ru_RU:ru"
ENV LC_MESSAGES "POSIX"
ENV TZ "Europe/Moscow"
WORKDIR /var/www/html
# PHP
RUN \
DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends\
php7.0\
php7.0-fpm\
php7.0-curl\
php7.0-mysql\
php7.0-xmlrpc\
php7.0-mcrypt\
php7.0-zip\
php-pear\
php-xdebug\
php-mbstring\
&& \
wget -O /usr/local/bin/composer https://getcomposer.org/composer.phar && \
chmod +x /usr/local/bin/composer && \
wget -O /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-6.phar && \
chmod +x /usr/local/bin/phpunit && \
rm -rf /var/lib/apt/lists/*
# UTILS
RUN \
DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends\
unzip\
curl\
mercurial\
git\
&& \
rm -rf /var/lib/apt/lists/*
# MYSQL CLIENT
RUN \
DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends\
mysql-client\
&& \
rm -rf /var/lib/apt/lists/*
# SETTINGS
RUN \
rm -f /etc/php/7.0/cli/php.ini && \
rm -f /etc/php/7.0/fpm/php-fpm.conf && \
rm -f /etc/php/7.0/fpm/php.ini && \
rm -f /etc/php/7.0/fpm/conf.d/20-xdebug.ini && \
rm -f /etc/php/7.0/cli/conf.d/20-xdebug.ini && \
rm -f /etc/php/7.0/mods-available/xdebug.ini && \
rm -f /etc/php/7.0/fpm/pool.d/www.conf
# CODE
COPY . .
RUN \
rm -rf vendor && \
rm -rf .hg && \
rm -f .hgignore && \
rm -rf templates/modern/design/bower_components && \
chown www-data:www-data -R .
# CRON & COMPOSER
USER www-data
RUN \
crontab crontab && \
composer install
USER root
VOLUME ["/etc/php/7.0/fpm/php-fpm.conf", "/etc/php/7.0/fpm/php.ini", "/etc/php/7.0/fpm/pool.d/www.conf", "/etc/php/7.0/cli/php.ini", "/var/log/php-fpm", "/var/www/html", "/var/www/data", "/tmp/project"]
CMD ["/usr/sbin/php-fpm7.0", "-F"]
EXPOSE 9000