Skip to content

Commit a18a71b

Browse files
author
Vien
committed
first release
0 parents  commit a18a71b

File tree

12 files changed

+269
-0
lines changed

12 files changed

+269
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
services/mysql/data/
2+
logs/
3+
.DS_Store
4+
*/.DS_Store
5+
*.log
6+
*.swp

apps/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# ignore all except .gitignore file
2+
*
3+
!.gitignore

docker-compose.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
version: "2"
2+
services:
3+
# mysql
4+
mysql:
5+
image: mysql:5.7.19
6+
container_name: weengine-mysql
7+
ports:
8+
- 3308:3306
9+
volumes:
10+
- ./services/mysql/data:/var/lib/mysql
11+
- ./services/mysql/config/mysql.conf.d/mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf
12+
- ./logs/mysql:/var/log/mysql
13+
- ./services/mysql/run/mysqld:/var/run/mysqld
14+
restart: always
15+
environment:
16+
MYSQL_ROOT_PASSWORD: luvvien1314
17+
MYSQL_DATABASE: weengine
18+
MYSQL_USER: weengine
19+
MYSQL_PASSWORD: luvvien1314@me
20+
21+
# php-fpm
22+
php-fpm:
23+
image: luvvien/docker-php-fpm-composer:latest
24+
container_name: weengine-php-fpm
25+
volumes:
26+
- ./apps:/apps
27+
- ./services/php/config/php.ini:/usr/local/etc/php/php.ini
28+
- ./services/php/config/www.conf:/usr/local/etc/php-fpm.d/www.conf
29+
- ./services/mysql/run/mysqld:/var/run/mysqld
30+
restart: always
31+
working_dir: /apps
32+
33+
# nginx
34+
nginx:
35+
image: nginx:latest
36+
container_name: weengine-nginx
37+
ports:
38+
- 8086:80
39+
- 10443:443
40+
links:
41+
- mysql
42+
depends_on:
43+
- php-fpm
44+
- mysql
45+
volumes:
46+
- ./apps:/apps
47+
- ./services/nginx/config/conf.d:/etc/nginx/conf.d:ro
48+
- ./services/nginx/config/cert:/etc/nginx/cert:ro
49+
- ./services/nginx/config/nginx.conf:/etc/nginx/nginx.conf
50+
- ./logs/nginx:/var/log/nginx
51+
restart: always
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# The MySQL Server configuration file.
3+
#
4+
5+
[client]
6+
default-character-set=utf8mb4
7+
8+
[mysql]
9+
default-character-set=utf8mb4
10+
11+
[mysqld]
12+
character-set-server=utf8mb4
13+
14+
pid-file = /var/run/mysqld/mysqld.pid
15+
socket = /var/run/mysqld/mysqld.sock
16+
datadir = /var/lib/mysql
17+
18+
#log-error = /var/log/mysql/error.log
19+
20+
# By default we only accept connections from localhost
21+
#bind-address = 127.0.0.1
22+
23+
# Disabling symbolic-links is recommended to prevent assorted security risks
24+
symbolic-links=0
25+
26+
27+
sql_mode=NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
28+
29+
max_allowed_packet=1600M

services/mysql/run/mysqld/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
services/mysql/data/
2+
logs/
3+
.DS_Store
4+
*/.DS_Store
5+
*.log
6+
*.swp
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# php upstream
2+
upstream php-upstream {
3+
server php-fpm:9000;
4+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
server {
2+
listen 80;
3+
server_name luv.vien.我爱你 luv.vien.xn--6qq986b3xl;
4+
return 301 https://luv.vien.xn--6qq986b3xl$request_uri;
5+
}
6+
7+
server {
8+
listen 443 ssl;
9+
10+
ssl on;
11+
ssl_certificate cert/ssl.crt;
12+
ssl_certificate_key cert/ssl.key;
13+
ssl_session_timeout 5m;
14+
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
15+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
16+
ssl_prefer_server_ciphers on;
17+
18+
root /apps/app/public;
19+
index index.php index.html index.htm;
20+
21+
server_name luv.vien.我爱你 luv.vien.xn--6qq986b3xl;
22+
if ( $host != 'luv.vien.xn--6qq986b3xl' ) {
23+
rewrite ^/(.*)$ https://luv.vien.xn--6qq986b3xl/$1 permanent;
24+
}
25+
26+
client_max_body_size 1024M;
27+
28+
access_log /var/log/nginx/blog_access.log;
29+
error_log /var/log/nginx/blog_error.log;
30+
31+
location / {
32+
try_files $uri $uri/ /index.php?$query_string;
33+
}
34+
35+
location ~ \.php$ {
36+
fastcgi_pass php-upstream;
37+
fastcgi_index index.php;
38+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
39+
include fastcgi_params;
40+
}
41+
# cache.appcache, your document html and data
42+
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
43+
expires -1;
44+
}
45+
46+
# Media: images, icons, video, audio, HTC
47+
location ~* \.(?:ttf|jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
48+
expires 1M;
49+
access_log off;
50+
add_header Cache-Control "public";
51+
}
52+
53+
# CSS and Javascript
54+
location ~* \.(?:css|js)$ {
55+
expires 1y;
56+
access_log off;
57+
add_header Cache-Control "public";
58+
}
59+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#server {
2+
# listen 80;
3+
# server_name _;
4+
#
5+
# root /apps/app/public;
6+
# index index.php index.html index.htm;
7+
#
8+
# access_log /var/log/nginx/access.log;
9+
# error_log /var/log/nginx/error.log;
10+
#
11+
# include conf.d/CommonWp.main;
12+
#
13+
#}

services/nginx/config/nginx.conf

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
user www-data;
2+
worker_processes auto;
3+
pid /run/nginx.pid;
4+
include /etc/nginx/modules-enabled/*.conf;
5+
6+
events {
7+
worker_connections 131072;
8+
use epoll;
9+
multi_accept on;
10+
}
11+
12+
http {
13+
14+
##
15+
# Basic Settings
16+
##
17+
18+
sendfile on;
19+
tcp_nopush on;
20+
tcp_nodelay on;
21+
keepalive_timeout 65;
22+
types_hash_max_size 2048;
23+
server_tokens off;
24+
25+
# allow soft link
26+
disable_symlinks off;
27+
28+
# server_names_hash_bucket_size 64;
29+
# server_name_in_redirect off;
30+
31+
include /etc/nginx/mime.types;
32+
default_type application/octet-stream;
33+
34+
##
35+
# SSL Settings
36+
##
37+
38+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
39+
ssl_prefer_server_ciphers on;
40+
41+
##
42+
# Logging Settings
43+
##
44+
45+
access_log /var/log/nginx/access.log;
46+
error_log /var/log/nginx/error.log;
47+
48+
##
49+
# Gzip Settings
50+
##
51+
52+
gzip on;
53+
gzip_disable "msie6";
54+
55+
# gzip_vary on;
56+
# gzip_proxied any;
57+
# gzip_comp_level 6;
58+
# gzip_buffers 16 8k;
59+
# gzip_http_version 1.1;
60+
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
61+
62+
##
63+
# Virtual Host Configs
64+
##
65+
66+
include /etc/nginx/conf.d/*.conf;
67+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
; 有关 opcache 可以参见:http://www.cnblogs.com/HD/p/4554455.html
2+
3+
opcache.memory_consumption=128
4+
opcache.interned_strings_buffer=8
5+
opcache.max_accelerated_files=4000
6+
opcache.revalidate_freq=60
7+
opcache.fast_shutdown=4
8+
opcache.enable_cli=1

0 commit comments

Comments
 (0)