-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
87 lines (82 loc) · 1.96 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
# syntax=docker/dockerfile:1
FROM clion007/alpine
# environment settings
ENV BRANCH v3.12
# The latest PHP7.3.33 and it's extensions contain in this version repository in alpine
# install packages
RUN set -eux; \
#install build packages
apk add --no-cache \
--repository=http://dl-cdn.alpinelinux.org/alpine/$BRANCH/main \
--repository=http://dl-cdn.alpinelinux.org/alpine/$BRANCH/community \
icu \
openssl \
memcached \
php7 \
php7-common \
php7-ctype \
php7-curl \
php7-fpm \
php7-iconv \
php7-json \
php7-mbstring \
php7-openssl \
php7-phar \
php7-session \
php7-simplexml \
php7-xml \
php7-xmlwriter \
php7-zip \
php7-bcmath \
php7-dom \
php7-ftp \
php7-gd \
php7-intl \
php7-mysqli \
php7-mysqlnd \
php7-opcache \
php7-pdo_mysql \
php7-pecl-memcached \
php7-pecl-redis \
php7-soap \
php7-sockets \
php7-sodium \
php7-sqlite3 \
php7-xmlreader \
php7-xsl \
php7-pecl-xdebug \
composer=1.10.19-r0; \
\
# Make dir for config and data
mkdir -p /config; \
\
# Add user for php process
# adduser -u 100 -D -S -G memcached memcached; \
# \
chown memcached:memcached /config; \
\
# guarantee correct php version is symlinked
if [ "$(readlink /usr/bin/php)" != "php7" ]; then \
rm -rf /usr/bin/php; \
ln -s /usr/bin/php7 /usr/bin/php; \
fi; \
\
# configure php
sed -i "s#;error_log = log/php7/error.log.*#error_log = /config/log/php/php73/error.log#g" \
/etc/php7/php-fpm.conf; \
sed -i "s#user = nobody.*#user = memcached#g" \
/etc/php7/php-fpm.d/www.conf; \
sed -i "s#group = nobody.*#group = memcached#g" \
/etc/php7/php-fpm.d/www.conf; \
sed -i "s#listen = 127.0.0.1:9000.*#listen = 0.0.0.0:9000#g" \
/etc/php7/php-fpm.d/www.conf; \
rm -rf \
/var/cache/apk/* \
/var/tmp/* \
/tmp/* \
;
# add local files
COPY --chmod=755 root/ /
# ports
EXPOSE 9000
CMD ["-F"]