forked from akopdev/bitrix24-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
142 lines (122 loc) · 3.98 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
FROM centos:7
# Add basics first
RUN yum -y install epel-release \
https://rpms.remirepo.net/enterprise/remi-release-7.rpm \
yum-utils && \
yum-config-manager --enable remi-php72
RUN yum update -y && yum upgrade -y && yum install -y initscripts \
wget \
httpd \
curl \
cronie \
ca-certificates \
openssl \
openssh \
git \
nano \
curl-devel \
expat-devel \
gettext-devel \
openssl-devel \
zlib-devel \
pcre-devel \
gcc \
gcc-c++ \
kernel-devel \
bind \
bind bind-utils \
&& yum clean -y all \
&& rm -rf -- /var/cache/yum/*
ENV container docker
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*; \
rm -f /etc/systemd/system/*.wants/*; \
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*; \
rm -f /lib/systemd/system/anaconda.target.wants/*;
# get desired nginx version (works with 1.6.2+)
ENV NGINX_PUSH_STREAM_MODULE_PATH=$PWD/nginx-push-stream-module
RUN git clone https://github.com/wandenberg/nginx-push-stream-module.git && \
wget https://nginx.org/download/nginx-1.16.1.tar.gz && tar xzvf nginx-1.16.1.tar.gz && \
cd nginx-1.16.1 && \
./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --add-module=../nginx-push-stream-module --with-http_gzip_static_module --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module \
&& make \
&& make install \
&& cd .. && rm -rf -- nginx-push-stream-module nginx-1.16.1 nginx-1.16.1.tar.gz
RUN ln -fs /usr/share/zoneinfo/Europe/Moscow /etc/localtime
RUN useradd -ms /bin/bash bitrix
# Configure version constraints
ENV PHP_ENABLE_XDEBUG=0 \
PATH=/app:/app/vendor/bin:/root/.composer/vendor/bin:$PATH \
TERM=linux \
VERSION_PRESTISSIMO_PLUGIN=^0.3.7 \
COMPOSER_ALLOW_SUPERUSER=1
# Setup apache and php
RUN yum install -y php \
php-cli \
php-json \
php-iconv \
php-intl \
php-ftp \
php-xdebug \
php-mcrypt \
php-mbstring \
php-soap \
php-gmp \
php-pdo_odbc \
php-dom \
php-pdo \
php-zip \
php-mysqli \
php-bcmath \
php-gd \
php-odbc \
php-pdo_mysql \
php-gettext \
php-xmlreader \
php-xmlwriter \
php-tokenizer \
php-xmlrpc \
php-bz2 \
php-curl \
php-ctype \
php-session \
php-exif \
php-opcache \
php-ldap \
# Create pid dir and send logs to stderr for Nginx
&& mkdir /run/nginx \
&& mkdir /var/log/nginx \
&& mkdir /home/bitrix/www \
&& yum clean -y all \
&& rm -rf -- /var/cache/yum/* \
&& chmod -R 777 /tmp
# Install composer
RUN curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer && \
composer clear-cache
# Nginx default server and PHP defaults
COPY ./etc /etc
COPY ./usr /usr
# A copy of bitrix setup scripts and initial settings
COPY ./www /usr/share/bitrix
# Get the latest version of bitrix scripts
ADD https://www.1c-bitrix.ru/download/files/scripts/bitrixsetup.php /usr/share/bitrix
ADD https://www.1c-bitrix.ru/download/files/scripts/restore.php /usr/share/bitrix
# Prepare the working folder with the bitrix install script in the image
RUN cp -a /usr/share/bitrix/. /home/bitrix/www/ && \
chown -R bitrix:bitrix /home/bitrix /usr/share/bitrix && \
mkdir -p -m 777 /home/bitrix/www/bitrix/tmp && \
chmod -R 777 /home/bitrix/www/bitrix/tmp
# named (dns server) service
RUN systemctl enable named.service && \
systemctl enable nginx.service && \
systemctl enable httpd.service && \
systemctl enable crond.service
# VOLUME /home/bitrix/www/
WORKDIR /home/bitrix/www
EXPOSE 80
EXPOSE 443
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
# CMD ["/usr/sbin/init"]