-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,194 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
|
||
/.idea | ||
/.idea | ||
|
||
/logs/nginx/ | ||
|
||
/code/ | ||
|
||
/etc/nginx/vhosts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
$redis = new Redis(); | ||
|
||
$client = $redis->connect('redis', '6379'); | ||
|
||
var_dump($client); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
version: '3' | ||
services: | ||
|
||
web: | ||
container_name: web | ||
build: ./web | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
- "6379:6379" | ||
volumes: | ||
- ./logs:/var/log | ||
- ./web/nginx/nginx.conf:/etc/nginx/nginx.conf | ||
- ./web/nginx/sites-enabled/:/etc/nginx/sites-enabled | ||
volumes: | ||
data-volume: | ||
web: | ||
image: nginx:alpine | ||
volumes: | ||
- "./etc/nginx/default.conf:/etc/nginx/conf.d/default.conf" | ||
- "./etc/nginx/nginx.conf:/etc/nginx/nginx.conf" | ||
- "./web:/var/www/html" | ||
- "./code:/var/www/code" | ||
- "./logs/nginx:/etc/nginx/logs" | ||
- "./etc/nginx/vhosts:/etc/nginx/vhosts" | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
command: /bin/sh -c "nginx -g 'daemon off;'" | ||
restart: always | ||
depends_on: | ||
- php | ||
- redis | ||
php: | ||
build: ./php | ||
restart: always | ||
volumes: | ||
- "./etc/php/php.ini:/usr/local/etc/php/conf.d/php.ini" | ||
- "./code:/var/www/code" | ||
- "./web:/var/www/html" | ||
redis: | ||
build: ./redis | ||
ports: | ||
- "6379:6379" | ||
restart: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
server { | ||
listen 80 default_server; | ||
listen [::]:80 default_server; | ||
server_name localhost; | ||
|
||
index index.php index.html; | ||
error_log /var/log/nginx/error.log; | ||
access_log /var/log/nginx/access.log; | ||
root /var/www/code; | ||
|
||
location ~ \.php$ { | ||
try_files $uri =404; | ||
fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
fastcgi_pass php:9000; | ||
fastcgi_index index.php; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_param PATH_INFO $fastcgi_path_info; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#user nobody; | ||
worker_processes auto; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
|
||
http { | ||
include mime.types; | ||
default_type application/octet-stream; | ||
sendfile off; | ||
#tcp_nopush on; | ||
client_max_body_size 100m; | ||
#keepalive_timeout 0; | ||
keepalive_timeout 65; | ||
# 开启gzip | ||
gzip on; | ||
# # 启用gzip压缩的最小文件,小于设置值的文件将不会压缩 | ||
gzip_min_length 1k; | ||
# # gzip 压缩级别,1-10,数字越大压缩的越好,也越占用CPU时间,后面会有详细说明 | ||
gzip_comp_level 2; | ||
# # 进行压缩的文件类型。javascript有多种形式。其中的值可以在 mime.types 文件中找到。 | ||
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png; | ||
# # 是否在http header中添加Vary: Accept-Encoding,建议开启 | ||
gzip_vary on; | ||
# # 禁用IE 6 gzip | ||
gzip_disable "MSIE [1-6]\."; | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
#charset koi8-r; | ||
|
||
#access_log logs/host.access.log main; | ||
|
||
location / { | ||
root html; | ||
index index.html index.htm; | ||
} | ||
|
||
#error_page 404 /404.html; | ||
|
||
# redirect server error pages to the static page /50x.html | ||
# | ||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root html; | ||
} | ||
|
||
} | ||
|
||
include ./vhosts/*.conf; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
; PHP Configuration | ||
|
||
;[Date] | ||
; Defines the default timezone used by the date functions | ||
; http://php.net/date.timezone | ||
;date.timezone = | ||
|
||
; Error handling | ||
;display_errors = Off | ||
|
||
; Xdebug | ||
; See https://xdebug.org/docs/all_settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM php:7.0.30-fpm | ||
RUN pecl install redis-4.0.1 \ | ||
&& docker-php-ext-enable redis \ | ||
&& docker-php-ext-install mysqli && docker-php-ext-enable mysqli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM redis:3.2-alpine | ||
|
||
COPY conf/redis.conf /usr/local/etc/redis/redis.conf | ||
CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ] | ||
|
||
EXPOSE 6379 |
Oops, something went wrong.