From 1e321f333167d4d5e0c46866b1fc203e15cd4825 Mon Sep 17 00:00:00 2001 From: KennyLee Date: Tue, 18 Apr 2017 15:17:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Esupervisord=E7=9A=84docker?= =?UTF-8?q?=E5=8C=96=E5=AE=B9=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logstash/README.md | 1 + nginx-pureftpd/docker-compose.yml | 14 +++--- nginx-pureftpd/nginx/Dockerfile | 43 ------------------- .../nginx/{ => config/conf.d}/default.conf | 0 nginx-pureftpd/nginx/config/nginx.conf | 31 +++++++++++++ supervisord/Dockerfile | 19 ++++++++ supervisord/supervisord.conf | 3 ++ 7 files changed, 61 insertions(+), 50 deletions(-) delete mode 100755 nginx-pureftpd/nginx/Dockerfile rename nginx-pureftpd/nginx/{ => config/conf.d}/default.conf (100%) create mode 100644 nginx-pureftpd/nginx/config/nginx.conf create mode 100755 supervisord/Dockerfile create mode 100644 supervisord/supervisord.conf diff --git a/logstash/README.md b/logstash/README.md index dba6ebe..73b97ef 100644 --- a/logstash/README.md +++ b/logstash/README.md @@ -7,5 +7,6 @@ * 默认163镜像源。 * 中国时区。 * 中文语言包 +* 安装logstash插件: gelf diff --git a/nginx-pureftpd/docker-compose.yml b/nginx-pureftpd/docker-compose.yml index b0596b4..a732c2c 100644 --- a/nginx-pureftpd/docker-compose.yml +++ b/nginx-pureftpd/docker-compose.yml @@ -1,20 +1,20 @@ version: '2' services: web: - build: nginx - container_name: "gitbook-web" + image: registry.cn-hangzhou.aliyuncs.com/kennylee/nginx:alpine-1.11.9 + container_name: "nginx" ports: - - "3022:80" - volumes: + - "80:80" + volumes: - ./data/html/:/usr/share/nginx/html - environment: - - TZ=Asia/Shanghai + - ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf + - ./nginx/conf/conf.d/:/etc/nginx/conf.d/ restart: always ftp: build: ftp container_name: "gitbook-ftp" ports: - - "3021:21" + - "21:21" - "30000-30009:30000-30009" volumes: - ./data/html/:/usr/share/nginx/html diff --git a/nginx-pureftpd/nginx/Dockerfile b/nginx-pureftpd/nginx/Dockerfile deleted file mode 100755 index cbbe5f7..0000000 --- a/nginx-pureftpd/nginx/Dockerfile +++ /dev/null @@ -1,43 +0,0 @@ -# Http Proxy -# -# see also https://github.com/nginxinc/docker-nginx -# Authoer: kennylee26 -# NAME: kennylee26/httpproxy -# Command format: Instruction [arguments command] .. - -# 第一行必须指定基于的基础镜像 -FROM registry.alauda.cn/kenny/docker-nginx - -# 维护者信息 -MAINTAINER kennylee26 - -ENV EGINX_HOME=/etc/nginx - -RUN echo "deb http://mirrors.163.com/debian/ jessie main non-free contrib\n\ - deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib\n\ - deb http://mirrors.163.com/debian/ jessie-backports main non-free contrib\n\ - deb-src http://mirrors.163.com/debian/ jessie main non-free contrib\n\ - deb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib\n\ - deb-src http://mirrors.163.com/debian/ jessie-backports main non-free contrib\n\ - deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib\n\ - deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib\n\ - deb http://ftp.cn.debian.org/debian jessie main" > /etc/apt/sources.list - -RUN apt-get -y update -# recommend -RUN apt-get install -y \ - curl vim wget - -# clean -RUN apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -VOLUME ["/var/cache/nginx"] -# web resource -VOLUME /usr/share/nginx/html - -ADD default.conf $EGINX_HOME/conf.d/ - -EXPOSE 80 443 - -CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx-pureftpd/nginx/default.conf b/nginx-pureftpd/nginx/config/conf.d/default.conf similarity index 100% rename from nginx-pureftpd/nginx/default.conf rename to nginx-pureftpd/nginx/config/conf.d/default.conf diff --git a/nginx-pureftpd/nginx/config/nginx.conf b/nginx-pureftpd/nginx/config/nginx.conf new file mode 100644 index 0000000..8f66c5c --- /dev/null +++ b/nginx-pureftpd/nginx/config/nginx.conf @@ -0,0 +1,31 @@ +user nginx; +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/nginx/conf.d/*.conf; +} diff --git a/supervisord/Dockerfile b/supervisord/Dockerfile new file mode 100755 index 0000000..b3433b1 --- /dev/null +++ b/supervisord/Dockerfile @@ -0,0 +1,19 @@ +# Ubuntu +# +# Base Docker Image http://dockerfile.github.io/#/ubuntu +# Authoer: kennylee26 + +FROM registry.cn-hangzhou.aliyuncs.com/kennylee/ubuntu + +MAINTAINER kennylee26 + +# Install. +RUN \ + apt-get update && \ + apt-get install -y inetutils-ping net-tools dnsutils supervisor && \ + rm -rf /var/lib/apt/lists/* + +COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf + +# Define default command. +CMD ["/usr/bin/supervisord"] diff --git a/supervisord/supervisord.conf b/supervisord/supervisord.conf new file mode 100644 index 0000000..3fb016d --- /dev/null +++ b/supervisord/supervisord.conf @@ -0,0 +1,3 @@ +[supervisord] +nodaemon=true +