-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunfile
More file actions
123 lines (100 loc) · 4.24 KB
/
Copy pathFunfile
File metadata and controls
123 lines (100 loc) · 4.24 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
112
113
114
115
116
117
118
119
120
121
122
123
RUNTIME custom
# Upgrade the base packages
RUN apt-get update
RUN apt-get upgrade -y
# Add a few PPAs to stay current
RUN apt-get -y install apt-transport-https lsb-release ca-certificates wget curl gnupg2
# PPA for PHP
RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
RUN sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
# PPA for nginx
RUN echo "deb http://nginx.org/packages/mainline/debian `lsb_release -cs` nginx" \
| tee /etc/apt/sources.list.d/nginx.list
RUN wget http://nginx.org/keys/nginx_signing.key
RUN apt-key add nginx_signing.key
# Update package list
RUN apt-get update
# Install nginx
RUN fun-install apt-get install nginx
# Install base PHP packages
RUN fun-install apt-get install php7.4-common
RUN fun-install apt-get install php7.4-fpm
RUN fun-install apt-get install php7.4-mysql
RUN fun-install apt-get install php7.4-bcmath
RUN fun-install apt-get install php7.4-ctype
RUN fun-install apt-get install php7.4-json
RUN fun-install apt-get install php7.4-mbstring
RUN fun-install apt-get install php7.4-tokenizer
RUN fun-install apt-get install php7.4-xml
RUN fun-install apt-get install php7.4-curl
RUN fun-install apt-get install php7.4-gd
RUN fun-install apt-get install php7.4-soap
RUN fun-install apt-get install php7.4-intl
RUN fun-install apt-get install php7.4-zip
RUN fun-install apt-get install php7.4-readline
RUN fun-install apt-get install libedit2
# Setup Nginx
RUN sed -i "s|pid /var/run/nginx.pid;|pid /tmp/.journey/nginx.pid;|" /code/.fun/root/etc/nginx/nginx.conf
RUN sed -i "s|include /etc/nginx/conf.d/\*.conf;|include /code/.fun/root/etc/nginx/conf.d/*.conf;|" /code/.fun/root/etc/nginx/nginx.conf
RUN sed -i "s|include /etc/nginx/mime.types;|include /code/.fun/root/etc/nginx/mime.types;|" /code/.fun/root/etc/nginx/nginx.conf
RUN sed -i "s|access_log /var/log/nginx/access.log main;|access_log off;|" /code/.fun/root/etc/nginx/nginx.conf
RUN sed -i "s|error_log /var/log/nginx/error.log warn;|error_log /dev/null crit;|" /code/.fun/root/etc/nginx/nginx.conf
RUN sed -i "/^http {/a proxy_temp_path /tmp/.journey/nginx/proxy;" /code/.fun/root/etc/nginx/nginx.conf
RUN sed -i "/^http {/a client_body_temp_path /tmp/.journey/nginx/body;" /code/.fun/root/etc/nginx/nginx.conf
RUN sed -i "/^http {/a fastcgi_temp_path /tmp/.journey/nginx/fastcgi;" /code/.fun/root/etc/nginx/nginx.conf
RUN sed -i "/^http {/a uwsgi_temp_path /tmp/.journey/nginx/uwsgi;" /code/.fun/root/etc/nginx/nginx.conf
RUN sed -i "/^http {/a scgi_temp_path /tmp/.journey/nginx/scgi;" /code/.fun/root/etc/nginx/nginx.conf
RUN echo "\
server {\n\
listen 9000;\n\
server_name localhost;\n\
\n\
charset utf-8;\n\
\n\
root /code/www;\n\
index index.php index.html index.htm;\n\
\n\
client_max_body_size 100M;\n\
\n\
location / {\n\
try_files \$uri \$uri/ /index.php?\$query_string;\n\
}\n\
\n\
location ~ \.php$ {\n\
include fastcgi_params;\n\
fastcgi_pass 127.0.0.1:9001;\n\
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n\
}\n\
}\n" > /code/.fun/root/etc/nginx/conf.d/default.conf
# Setup FPM
RUN sed -i "s|pid = /run/php/php7.4-fpm.pid|pid = /tmp/.journey/php-fpm.pid|" /code/.fun/root/etc/php/7.4/fpm/php-fpm.conf
RUN sed -i "s|error_log = /var/log/php7.4-fpm.log|error_log = /dev/null|" /code/.fun/root/etc/php/7.4/fpm/php-fpm.conf
RUN sed -i "s|include=/etc/php/7.4/fpm/pool.d/\*.conf|include=/code/.fun/root/etc/php/7.4/fpm/pool.d/*.conf|" /code/.fun/root/etc/php/7.4/fpm/php-fpm.conf
RUN sed -i "s|listen = /run/php/php7.4-fpm.sock|listen = 127.0.0.1:9001|" /code/.fun/root/etc/php/7.4/fpm/pool.d/www.conf
# Setup PHP
# Enable extensions
RUN echo '\n\
extension_dir="/code/.fun/root/usr/lib/php/20190902"\n\
\n\
extension=mysqlnd\n\
extension=mysqli\n\
extension=pdo\n\
extension=pdo_mysql\n\
extension=bcmath\n\
extension=ctype\n\
extension=json\n\
extension=mbstring\n\
extension=tokenizer\n\
extension=xml\n\
extension=exif\n\
extension=fileinfo\n\
extension=curl\n\
extension=iconv\n\
extension=gettext\n\
extension=zip\n\
extension=soap\n\
extension=gd\n\
extension=intl\n\
extension=readline\n\
zend_extension=opcache\n\
\n' | tee -a /code/.fun/root/usr/lib/php/7.4/php.ini-production > /dev/null