File tree Expand file tree Collapse file tree 2 files changed +90
-0
lines changed
sample-docker-templates/php/php7.4 Expand file tree Collapse file tree 2 files changed +90
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM ubuntu:20.04
2+
3+ RUN apt-get update
4+ RUN apt-get -y upgrade
5+
6+ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --fix-missing php7.4 \
7+ php7.4-cli \
8+ php-fpm \
9+ php7.4-mysql \
10+ php7.4-curl \
11+ net-tools
12+
13+ RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y nginx-full
14+ ADD nginx-site.conf /etc/nginx/sites-available/default
15+
16+ WORKDIR /var/www/html/
17+
18+ RUN mkdir -p /run/php
19+
20+ COPY . /var/www/html
21+
22+ EXPOSE 80
23+
24+ CMD ["/bin/bash" , "-c" , "service php7.4-fpm start && nginx -g \" daemon off;\" " ]
Original file line number Diff line number Diff line change 1+ server {
2+ listen 80; ## listen for ipv4; this line is default and implied
3+ listen [::]:80 default ipv6only=on; ## listen for ipv6
4+
5+ root /var/www/html;
6+ index index.php index.html index.htm;
7+
8+ # Make site accessible from http://localhost/
9+ server_name _;
10+
11+ # Disable sendfile as per https://docs.vagrantup.com/v2/synced-folders/virtualbox.html
12+ sendfile off;
13+
14+ # Add stdout logging
15+
16+ error_log /dev/stdout info;
17+ access_log /dev/stdout;
18+
19+ location / {
20+ try_files $uri $uri/ =404;
21+ }
22+
23+ error_page 404 /404.html;
24+ location = /404.html {
25+ root /var/www/errors;
26+ internal;
27+ }
28+
29+ location ^~ /ngd-style.css {
30+ alias /var/www/errors/style.css;
31+ access_log off;
32+ }
33+
34+ location ^~ /ngd-sad.svg {
35+ alias /var/www/errors/sad.svg;
36+ access_log off;
37+ }
38+
39+ # Pass the PHP scripts to FastCGI server listening on socket
40+ location ~ \.php$ {
41+ try_files $uri =404;
42+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
43+ fastcgi_pass unix:/run/php/php7.4-fpm.sock;
44+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
45+ fastcgi_param SCRIPT_NAME $fastcgi_script_name;
46+ fastcgi_index index.php;
47+ include fastcgi_params;
48+ }
49+
50+ location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
51+ expires 5d;
52+ }
53+
54+ # deny access to . files, for security
55+ #
56+ location ~ /\. {
57+ log_not_found off;
58+ deny all;
59+ }
60+
61+ location ^~ /.well-known {
62+ allow all;
63+ auth_basic off;
64+ }
65+
66+ }
You can’t perform that action at this time.
0 commit comments