-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.workers
More file actions
111 lines (93 loc) · 3.13 KB
/
Dockerfile.workers
File metadata and controls
111 lines (93 loc) · 3.13 KB
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:xenial
LABEL version="1.4.2"
LABEL php.version="7.3"
ARG environment=production
ARG time_zone=UTC
ARG supervisord_conf=conf/supervisord/supervisord.conf
ENV APP_ENV=${environment}
ENV APPLICATION_ENV=${environment}
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get -y --no-install-recommends install \
software-properties-common \
python-software-properties \
language-pack-en-base \
git \
curl \
vim \
zip \
unzip \
nginx \
supervisor \
apt-utils
# Add repository
RUN PPAPHP7="ppa:ondrej/php" && \
export LC_ALL=en_US.UTF-8 && \
export LANG=en_US.UTF-8 && \
add-apt-repository $PPAPHP7 \
&& apt-get update
# Create folder for fpm.sock
RUN mkdir /run/php/
RUN touch /run/php/php7.3-fpm.sock
RUN chown -R www-data:www-data /run/php/
RUN chmod -R 0660 /run/php/
# Install packages
RUN apt-get -y install \
php7.3 \
php7.3-common \
php7.3-dom \
php7.3-mbstring \
php7.3-mysql \
php7.3-pdo \
php7.3-xml \
php7.3-phar \
php7.3-json \
php7.3-gd \
php7.3-curl \
php7.3-bcmath \
php7.3-soap \
php7.3-zip \
php7.3-geoip \
php7.3-intl \
php7.3-sqlite3 \
php-apcu \
php-memcached \
php-redis
# Install PEAR (PECL) and dev for extensions
RUN apt-get install -y php-pear php7.3-dev
# Prepare mcrypt install
RUN apt-get -y install gcc make autoconf libc-dev pkg-config \
libmcrypt-dev
# Allow PECL to parse php.ini by removing -n
# othersise it can't find the required php-xml
# RUN sed -i "$ s|\-n||g" /usr/bin/pecl
# Or require only the XML extension
# pecl needs xml extension and since we build it as shared, it must be
# explicitly declared to be loaded.
#RUN sed -i 's/\$INCARG/& -d extension=xml.so/' \
# "$pkgdir"/usr/bin/pecl || return 1
# Install mcrypt
RUN /usr/bin/pecl install mcrypt-1.0.2
# clear apt cache and remove unnecessary packages
RUN apt-get autoclean && apt-get -y autoremove
# Install Composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
RUN php composer-setup.php --install-dir=/usr/bin/
RUN php -r "unlink('composer-setup.php');"
RUN ln -s /usr/bin/composer.phar /usr/bin/composer && chmod a+x /usr/bin/composer
# Install PEAR
RUN apt-get install php-pear
# Configure php.ini
RUN sed -i \
-e "s/^expose_php.*/expose_php = Off/" \
-e "s/^;date.timezone.*/date.timezone = ${time_zone}/" \
-e "s/^memory_limit.*/memory_limit = -1/" \
-e "s/^max_execution_time.*/max_execution_time = 0/" \
-e "s/^post_max_size.*/post_max_size = 0M/" \
-e "s/^upload_max_filesize.*/upload_max_filesize = 0M/" \
/etc/php/7.3/cli/php.ini
# Add application
RUN mkdir -p /var/www
WORKDIR /var/www
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]