Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 10c34eb

Browse files
committed
fixed php-fpm startup issue
added build envs
1 parent 5d2de64 commit 10c34eb

File tree

6 files changed

+2059
-1
lines changed

6 files changed

+2059
-1
lines changed

‎Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ FROM php:7-fpm-alpine
33

44
MAINTAINER Adrian7 <adrian.silimon@yahoo.com>
55

6+
#Arguments
7+
ARG BUILD_CONFIG=dev
8+
69
#Install
710

811
RUN apk --no-cache add \
@@ -36,8 +39,12 @@ RUN apk --no-cache add \
3639

3740
#Configure
3841

42+
COPY ./config-${BUILD_CONFIG}/nginx-host-template.conf /etc/nginx/sites-available/template.conf
43+
COPY ./config-${BUILD_CONFIG}/nginx.conf /etc/nginx/nginx.conf
44+
COPY ./config-${BUILD_CONFIG}/php.ini /usr/local/etc/php/php.ini
45+
COPY ./config-${BUILD_CONFIG}/supervisord.conf /etc/supervisord.conf
46+
3947
COPY ./container.sh /home/bin/container
40-
COPY ./nginx-host-template.conf /etc/nginx/sites-available/template.conf
4148
COPY ./start.sh /start.sh
4249

4350
#Set volumes

‎config-dev/nginx-host-template.conf

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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 __ROOTDIR__;
6+
index index.php index.html index.htm;
7+
8+
client_body_temp_path /tmp 1 2;
9+
10+
# Make site accessible from http://localhost
11+
server_name localhost;
12+
13+
# Disable sendfile as per https://docs.vagrantup.com/v2/synced-folders/virtualbox.html
14+
sendfile off;
15+
16+
# Add stdout logging
17+
error_log /dev/stdout info;
18+
access_log /dev/stdout;
19+
20+
location / {
21+
# First attempt to serve request as file, then
22+
# as directory, then fall back to index.html
23+
try_files $uri $uri/ /index.php$is_args$args;
24+
}
25+
26+
#error_page 404 /404.html;
27+
28+
# redirect server error pages to the static page /50x.html
29+
#error_page 500 502 503 504 /50x.html;
30+
31+
#location = /50x.html {
32+
# root /usr/share/nginx/html;
33+
#}
34+
35+
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
36+
#
37+
location ~ \.php$ {
38+
39+
try_files $uri =404;
40+
41+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
42+
fastcgi_pass 127.0.0.1:9000;
43+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
44+
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
45+
fastcgi_index index.php;
46+
47+
include fastcgi_params;
48+
49+
}
50+
51+
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
52+
expires 30s;
53+
}
54+
55+
# deny access to . files
56+
#
57+
location ~ /\. {
58+
log_not_found off;
59+
deny all;
60+
}
61+
62+
}

‎config-dev/nginx.conf

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
user www-data;
2+
worker_processes auto;
3+
pid /run/nginx.pid;
4+
5+
# Daemonize
6+
daemon off;
7+
8+
events {
9+
worker_connections 2048;
10+
multi_accept on;
11+
}
12+
13+
http {
14+
15+
##
16+
# Basic Settings
17+
##
18+
19+
sendfile on;
20+
tcp_nopush on;
21+
tcp_nodelay on;
22+
23+
keepalive_timeout 15;
24+
client_max_body_size 64m;
25+
types_hash_max_size 2048;
26+
27+
# server_tokens off;
28+
29+
# server_names_hash_bucket_size 64;
30+
# server_name_in_redirect off;
31+
32+
include /etc/nginx/mime.types;
33+
default_type application/octet-stream;
34+
35+
##
36+
# SSL Settings
37+
##
38+
39+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
40+
ssl_prefer_server_ciphers on;
41+
42+
##
43+
# Logging Settings
44+
##
45+
46+
access_log /var/log/nginx/access.log;
47+
error_log /var/log/nginx/error.log;
48+
49+
##
50+
# Gzip Settings
51+
##
52+
53+
gzip on;
54+
gzip_disable "msie6";
55+
56+
# gzip_vary on;
57+
# gzip_proxied any;
58+
# gzip_comp_level 6;
59+
# gzip_buffers 16 8k;
60+
# gzip_http_version 1.1;
61+
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
62+
63+
##
64+
# Virtual Host Configs
65+
##
66+
67+
include /etc/nginx/conf.d/*.conf;
68+
include /etc/nginx/sites-enabled/*;
69+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /