-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
84 lines (63 loc) · 2.76 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
FROM centos:7.2.1511
# tags: php72-swooleloader-1.9.0
# 初始设置
RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm &&\
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm &&\
yum makecache &&\
yum install -y vim tar wget curl bzip2 net-tools lsof sysstat cronie python-setuptools &&\
yum install php72w php72w-cli php72w-common php72w-fpm php72w-bcmath php72w-gd php72w-mbstring php72w-pdo php72w-mysqlnd php72w-mcrypt nginx1w -y &&\
yum install perl perl-Data-Dumper libaio* libnuma* -y &&\
yum clean all && rm -rf /tmp/* && rm -rf /var/tmp/* &&\
easy_install supervisor &&\
cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# 安装软件
#RUN yum clean all &&\
# yum install epel-release -y &&\
# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm &&\
# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm &&\
# yum makecache &&\
# yum install php72w php72w-common php72w-fpm php72w-bcmath php72w-gd php72w-mbstring php72w-pdo php72w-mysqlnd nginx1w -y &&\
# yum install perl perl-Data-Dumper libaio* libnuma* -y &&\
# yum clean all && rm -rf /tmp/* && rm -rf /var/tmp/*
ENV fpm_conf /etc/php-fpm.d/www.conf
#copy nginx-site
#RUN rm -Rf /usr/local/nginx/conf/vhosts/* && rm -Rf /usr/local/nginx/conf/nginx.conf
ADD conf/nginx.conf /etc/nginx/nginx.conf
ADD conf/php_fcgi.conf /etc/nginx/php_fcgi.conf
ADD conf/pathinfo.conf /etc/nginx/pathinfo.conf
ADD conf/nginx-site.conf /etc/nginx/conf.d/nginx-site.conf
#copy swoole-loader
ADD deploy/swoole_loader72.so /usr/lib64/php/modules/swoole_loader72.so
ADD deploy/libsodium.so.23 /usr/lib64/libsodium.so.23
ADD conf/swoole_loader.ini /etc/php.d/swoole_loader.ini
# tweak php-fpm and zend config
RUN adduser www &&\
sed -i \
-e "s/pm = dynamic/pm = static/g" \
-e "s/pm.max_children = 50/pm.max_children = 5/g" \
-e "s/user = apache/user = www/g" \
-e "s/group = apache/group = www/g" \
${fpm_conf}
#ADD link
#RUN ln -s /usr/local/php56/bin/php /usr/local/bin/php &&\
#ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/nginx
#copy supervisord
RUN rm -Rf /etc/supervisord.conf
ADD conf/supervisord.conf /etc/supervisord.conf
# Add Scripts
RUN rm -Rf /start.sh
ADD scripts/start.sh /start.sh
RUN chmod 755 /start.sh
# 安装mysql(选填)
#RUN yum clean all &&\
# yum install mysql56 &&\
# rm -rf /data/mysql/3306/ib* /data/mysql/3306/*-bin.* /data/mysql/3306/test &&\
# yum clean all && rm -rf /tmp/* && rm -rf /var/tmp/* &&\
# rm -Rf /usr/local/mysql/my.cnf
#ADD conf/my.cnf /usr/local/mysql/my.cnf
# copy in code
#RUN rm -Rf /data/httpd/*
#ADD httpd.tar /data/
#VOLUME /data/httpd
EXPOSE 443 80 22
CMD ["/start.sh"]