From 7e404d5627d73c37a91481afdc2c86078c6f7063 Mon Sep 17 00:00:00 2001 From: KennyLee Date: Tue, 2 Feb 2016 23:28:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Efinalspeed-serv=E7=9A=84docke?= =?UTF-8?q?r=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- finalspeed-serv/Dockerfile | 31 ++++++++++++++++++++++++++++++ finalspeed-serv/README.md | 6 ++++++ finalspeed-serv/docker-compose.yml | 7 +++++++ finalspeed-serv/run.sh | 7 +++++++ gitbook/Dockerfile | 2 ++ share-server/README.md | 6 +++++- share-server/docker-compose.yml | 14 ++++++++++++-- 7 files changed, 70 insertions(+), 3 deletions(-) create mode 100755 finalspeed-serv/Dockerfile create mode 100755 finalspeed-serv/README.md create mode 100644 finalspeed-serv/docker-compose.yml create mode 100644 finalspeed-serv/run.sh diff --git a/finalspeed-serv/Dockerfile b/finalspeed-serv/Dockerfile new file mode 100755 index 0000000..4afaa23 --- /dev/null +++ b/finalspeed-serv/Dockerfile @@ -0,0 +1,31 @@ +# finalspeed-server +# NAME: kennylee26/fs-server + +# Pull base image. +FROM kennylee26/java7 + +# Basic Requirements +RUN \ + apt-get update && \ + apt-get install -y unzip wget libpcap-dev iptables + +RUN apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +ENV FS_HOME="/fs" +ENV FS_SERVER_URL="http://fs.d1sm.net/finalspeed/finalspeed_server.zip" +ENV FS_SERVER_NAME="finalspeed_server.zip" + +RUN mkdir -p $FS_HOME +WORKDIR $FS_HOME + +RUN wget -O $FS_SERVER_NAME $FS_SERVER_URL +RUN unzip -o $FS_SERVER_NAME -d $FS_HOME +RUN chmod +x $FS_HOME/restart.sh + +EXPOSE 150 + +ADD run.sh /run.sh +RUN chmod +x /*.sh + +CMD ["/run.sh"] diff --git a/finalspeed-serv/README.md b/finalspeed-serv/README.md new file mode 100755 index 0000000..08077aa --- /dev/null +++ b/finalspeed-serv/README.md @@ -0,0 +1,6 @@ +FinalSpeed服务端 +--- + +由于FinalSpeed服务端的说明比较少,一般都是简短的安装和使用教程,所以有些细节的地方不知道放到docker环境下是否有影响。 + +除了目前官方说明的150监听端口外,发现客户端连接的时候还会监听48xxx的随机端口。所以为了方便,设置为net为host。 \ No newline at end of file diff --git a/finalspeed-serv/docker-compose.yml b/finalspeed-serv/docker-compose.yml new file mode 100644 index 0000000..7411d15 --- /dev/null +++ b/finalspeed-serv/docker-compose.yml @@ -0,0 +1,7 @@ +app: + build: . + container_name: fs_server + environment: + - TZ=Asia/Shanghai + restart: always + net: host #因为没说明server的监听说明,十分纠结,虽然怀疑会随机监听48000-50000的端口,但为了一劳永逸,暂时偷懒host diff --git a/finalspeed-serv/run.sh b/finalspeed-serv/run.sh new file mode 100644 index 0000000..2f8f48b --- /dev/null +++ b/finalspeed-serv/run.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +install_path=/fs/ + +sh ${install_path}"restart.sh" +sleep 1s +tail -f ${install_path}"server.log" diff --git a/gitbook/Dockerfile b/gitbook/Dockerfile index cfaf80c..e82a2c8 100755 --- a/gitbook/Dockerfile +++ b/gitbook/Dockerfile @@ -21,6 +21,8 @@ RUN cnpm install gitbook-cli -g && \ RUN gitbook versions:install $GIT_BOOK_VERSION +# install recommend plugins + RUN apt-get clean && \ rm -rf /var/lib/apt/lists/* diff --git a/share-server/README.md b/share-server/README.md index de206c4..a97fa8c 100755 --- a/share-server/README.md +++ b/share-server/README.md @@ -7,4 +7,8 @@ 1. ftp支持上传和下载功能。账号: ftp 密码 ftp 2. samba仅支持下载。 -注意 docker-compose.yml 文件中的一些本地路径映射的配置,根据实际情况来修改。 \ No newline at end of file +注意 docker-compose.yml 文件中的一些本地路径映射的配置,根据实际情况来修改。 + +-------- + +FTP配置信息,参见:http://download.pureftpd.org/pub/pure-ftpd/doc/README \ No newline at end of file diff --git a/share-server/docker-compose.yml b/share-server/docker-compose.yml index 58dd6eb..d332fdc 100644 --- a/share-server/docker-compose.yml +++ b/share-server/docker-compose.yml @@ -1,6 +1,6 @@ ftp: image: kennylee26/pureftpd - container_name: "pureftpd" + container_name: "share-pureftpd" net: "host" # none but net=host, windows user can be work. # Please create these folders at before. volumes: @@ -11,7 +11,7 @@ ftp: - TZ=Asia/Shanghai samba: image: vimagick/samba - container_name: "samba" + container_name: "share-samba" ports: - "137:137/udp" - "138:138/udp" @@ -24,3 +24,13 @@ samba: restart: always environment: - TZ=Asia/Shanghai +http: + image: nginx:1.9.8 + container_name: "share-http" + ports: + - "8001:80" + volumes: + - /home/data/ftp/files/ftp:/usr/share/nginx/html + environment: + - TZ=Asia/Shanghai + restart: always