成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專(zhuān)欄INFORMATION COLUMN

Mono、Nginx、Jexus組合測(cè)試

whinc / 1238人閱讀

摘要:因?yàn)橐獙⑵脚_(tái)和應(yīng)用化,需要測(cè)試并選擇部署工具及方式。頁(yè)面部署獨(dú)立版相關(guān)部署獨(dú)立版說(shuō)明獨(dú)立版是指將的集成進(jìn)來(lái)的,據(jù)說(shuō)使用上跟差不多。接下來(lái)新建文件夾點(diǎn)擊下載打包好的文件文件中的文件夾分別用于存放要部署的三類(lèi)文件。

因?yàn)橐獙⑵脚_(tái)和應(yīng)用Docker化,需要測(cè)試并選擇部署工具及方式。

頁(yè)面部署:
Nginx;Jexus;Jexus獨(dú)立版;

.Net相關(guān)(MVC、API、exe)部署:
Mono + Nginx;Mono + Jexus;Mono + Jexus獨(dú)立版;

說(shuō)明:Jexus獨(dú)立版是指將Mono的RunTime集成進(jìn)來(lái)的Jexus,據(jù)說(shuō)使用上跟Mono + Jexus差不多。
接下來(lái)新建文件夾:

sudo mkdir /opt/webapi && cd /opt/webapi

點(diǎn)擊下載打包好的demo文件;
文件中的web mvc api文件夾分別用于存放要部署的三類(lèi)demo文件。

點(diǎn)擊下載打包好的Dockerfile和腳本文件;
文件中的jexus nginx jexus-mono mono-jexus mono-jexus-mono mono-nginx文件夾分別存放了構(gòu)建鏡像的Dockerfile文件和一些構(gòu)建鏡像的腳本以及容器啟停的腳本,以免測(cè)試過(guò)程中總是重復(fù)輸入一些指令或上下翻找這些重復(fù)的指令。

注意:這些文件夾要放到同一路徑下,因?yàn)槿萜鞯膯?dòng)腳本中使用了相對(duì)路徑,這里我放到了新建的文件夾webapi下面,即/opt/webapi路徑下。web mvc api文件夾下放的都是要部署的demo文件,這里就不貼出來(lái)了。

jexus

官方網(wǎng)站

Dockerfile

FROM debian:jessie
MAINTAINER Mongo 

RUN apt-get update 
        && apt-get -y install wget 
        && cd /usr 
        && wget linuxdot.net/down/jexus-5.8.1.tar.gz 
        && tar -zxvf jexus-5.8.1.tar.gz 
        && ./jexus-5.8.1/install 
        && rm -r jexus-5.8.1.tar.gz jexus-5.8.1 
        && apt-get -y autoremove --purge wget 
        && rm -rf /var/lib/apt/lists/*

EXPOSE 80
WORKDIR /usr/jexus
CMD  /usr/jexus/jws start && tail -f

build.sh

#!/bin/bash

./stop.sh

docker build -t jexus/debian .

docker rmi $(docker images | awk "$1 == "" && $2 == "" {print $3}")

start.sh

#!/bin/bash

./stop.sh

EXPORT="11110"

docker run -d -p $EXPORT:80 --name jexus-web -v $(pwd)/../web:/var/www/default --restart always jexus/debian:latest

echo
ip addr show eth1 | awk "$1 == "inet" {split($2,ip,"/");print "Please use the browser to access this address => http://"ip[1]":""""$EXPORT"""}"
echo

stop.sh

#!/bin/bash

docker rm -f jexus-web

jexus-mono

Dockerfile

FROM debian:jessie
MAINTAINER Mongo 

RUN apt-get update 
        && apt-get -y install wget 
        && cd /usr 
        && wget linuxdot.net/down/jexus-5.8.1-x64.tar.gz 
        && tar -zxvf jexus-5.8.1-x64.tar.gz 
        && rm -r jexus-5.8.1-x64.tar.gz 
        && apt-get -y autoremove --purge wget 
        && rm -rf /var/lib/apt/lists/*

EXPOSE 80
WORKDIR /usr/jexus
CMD /usr/jexus/jwss

build.sh

#!/bin/bash

./stop.sh

docker build -t jexus/mono:debian .

docker rmi $(docker images | awk "$1 == "" && $2 == "" {print $3}")

start.sh

#!/bin/bash

./stop.sh

webport="11120"
mvcport="11122"
apiport="11124"

docker run -d -p $webport:80 --name jexus-mono-web -v $(pwd)/../web:/var/www/default --restart always jexus/mono:debian

docker run -d -p $mvcport:80 --name jexus-mono-mvc -v $(pwd)/../mvc:/var/www/default --restart always jexus/mono:debian

docker run -d -p $apiport:80 --name jexus-mono-api -v $(pwd)/../api:/var/www/default --restart always jexus/mono:debian

echo
ip addr show eth1 | awk "$1 == "inet" {split($2,ip,"/");print "(OK)WEB - Please use the browser to access this address => http://"ip[1]":""""$webport"""}"
echo
ip addr show eth1 | awk "$1 == "inet" {split($2,ip,"/");print "MVC - Please use the browser to access this address => http://"ip[1]":""""$mvcport"""}"
echo
ip addr show eth1 | awk "$1 == "inet" {split($2,ip,"/");print "API - Please use the browser to access this address => http://"ip[1]":""""$apiport"""}"
echo

stop.sh

#!/bin/bash

docker rm -f jexus-mono-web jexus-mono-api jexus-mono-mvc

nginx

官方網(wǎng)站 ; Nginx中文文檔 ; nginx官方鏡像及使用說(shuō)明

Dockerfile(官方)

FROM debian:jessie

MAINTAINER NGINX Docker Maintainers "[email protected]"

ENV NGINX_VERSION 1.11.1-1~jessie

RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 
    && echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list 
    && apt-get update 
    && apt-get install --no-install-recommends --no-install-suggests -y 
                        ca-certificates 
                        nginx=${NGINX_VERSION} 
                        nginx-module-xslt 
                        nginx-module-geoip 
                        nginx-module-image-filter 
                        nginx-module-perl 
                        nginx-module-njs 
                        gettext-base 
    && rm -rf /var/lib/apt/lists/*

# forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log 
    && ln -sf /dev/stderr /var/log/nginx/error.log

EXPOSE 80 443

CMD ["nginx", "-g", "daemon off;"]

start.sh

#!/bin/bash

./stop.sh

webport="11160"

# OK
docker run -d -p $webport:80 --name nginx-web -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf -v $(pwd)/../web:/usr/share/nginx/html --restart always nginx:latest

echo " "
ip addr show eth1 | awk "$1 == "inet" {split($2,ip,"/");print "(OK)WEB - Please use the browser to access this address => http://"ip[1]":""""$webport"""}"

stop.sh

#!/bin/bash

docker rm -f nginx-web

mono (official)

官方網(wǎng)站 ; Mono-Wiki ; DockerHub-Mono

Dockerfile(官方)

FROM debian:wheezy

MAINTAINER Jo Shields 

#based on dockerfile by Michael Friis 

RUN apt-get update 
    && apt-get install -y curl 
    && rm -rf /var/lib/apt/lists/*

RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

RUN echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots/4.4.0.182 main" > /etc/apt/sources.list.d/mono-xamarin.list 
    && apt-get update 
    && apt-get install -y mono-devel ca-certificates-mono fsharp mono-vbnc nuget referenceassemblies-pcl 
    && rm -rf /var/lib/apt/lists/*

start.sh

#!/bin/bash

./stop.sh

path="/usr/src/app/source"
cmd="mono ./example.exe"
cname="mono-official-exe"

docker run -d -v $(pwd)/../exe:$path -w $path --name $cname mono:latest $cmd

docker logs -f $cname

stop.sh

#!/bin/bash

docker rm -f mono-official-exe

mono (seif/mono)

DockerHub-seif/mono ; 需要說(shuō)明的是Mono的官方鏡像也是seif在更新維護(hù)的,另外他還上傳了其他Mono的相關(guān)鏡像:seif/mono-nginx ; seif/docker-mono-fastcgi-nginx (就是下面用到的mono/nginx) ; seif/mono-apache ; seif/mono-runit ;

Dockerfile

FROM debian

MAINTAINER Seif Attar 

RUN apt-get update 
        && apt-get install wget  -y --no-install-recommends 
        && echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots/4.0.0 main" > /etc/apt/sources.list.d/mono-xamarin.list 
        && wget -qO - http://download.mono-project.com/repo/xamarin.gpg | apt-key add - 
        && apt-get update 
        && apt-get install mono-runtime -y --no-install-recommends 
        && apt-get purge wget -y 
        && apt-get autoremove -y 
        && apt-get clean 
        && rm -rf /var/lib/apt/lists/* /var/tmp/*

start.sh

#!/bin/bash

./stop.sh

path="/usr/src/app/source"
cmd="mono ./example.exe"
cname="mono-seif-exe"

docker run -d -v $(pwd)/../exe:$path -w $path --name $cname mono:latest $cmd

docker logs -f $cname

stop.sh

docker rm -f mono-seif-exe

mono-jexus

Dockerfile

FROM mono:latest
MAINTAINER Mongo 

RUN apt-get update 
        && apt-get -y install wget 
        && cd /usr 
        && wget linuxdot.net/down/jexus-5.8.1.tar.gz 
        && tar -zxvf jexus-5.8.1.tar.gz 
        && ./jexus-5.8.1/install 
        && rm -r jexus-5.8.1.tar.gz jexus-5.8.1 
        && apt-get -y autoremove --purge wget 
        && rm -rf /var/lib/apt/lists/*

EXPOSE 80
WORKDIR /usr/jexus
CMD  /usr/jexus/jws start && tail -f

build.sh

#!/bin/bash

./stop.sh

docker build -t mono/jexus .

docker rmi $(docker images | awk "$1 == "" && $2 == "" {print $3}")

start.sh

#!/bin/bash

./stop.sh

mvcport="11132"
apiport="11134"
tiport="11136"

docker run -d -p $mvcport:80 --name mono-jexus-mvc -v $(pwd)/../mvc:/var/www/default mono/jexus

docker run -d -p $apiport:80 --name mono-jexus-api -v $(pwd)/../api:/var/www/default mono/jexus
echo " "
ip addr show eth1 | awk "$1 == "inet" {split($2,ip,"/");print "MVC - Please use the browser to access this address => http://"ip[1]":""""$mvcport"""}"
echo " "
ip addr show eth1 | awk "$1 == "inet" {split($2,ip,"/");print "API - Please use the browser to access this address => http://"ip[1]":""""$apiport"""}"
echo " "
ip addr show eth1 | awk "$1 == "inet" {split($2,ip,"/");print "(OK)MVC-tiMode - Please use the browser to access this address => http://"ip[1]":""""$tiport"""}"
echo " "
# OK
docker run --rm -ti -p $tiport:80 --name jexus-mono-mvc-ti -v $(pwd)/../mvc:/var/www/default mono/jexus

stop.sh

#!/bin/bash

docker rm -f mono-jexus-mvc mono-jexus-api

mono-jexus-mono

Dockerfile

FROM mono:latest
MAINTAINER Mongo 

RUN apt-get update 
        && apt-get -y install wget 
        && cd /usr 
        && wget linuxdot.net/down/jexus-5.8.1-x64.tar.gz 
        && tar -zxvf jexus-5.8.1-x64.tar.gz 
        && apt-get -y autoremove --purge wget 
        && rm -rf jexus-5.8.1-x64.tar.gz /var/lib/apt/lists/*

# COPY default /usr/jexus/siteconf/default
EXPOSE 80
WORKDIR /usr/jexus
CMD /usr/jexus/jwss

build.sh

#!/bin/bash

./stop.sh

docker build -t mono/jexus:mono .

docker rmi $(docker images | awk "$1 == "" && $2 == "" {print $3}")

start.sh

#!/bin/bash

./stop.sh

mvcport="11142"
apiport="11144"
tiport="11146"

docker run -d -p $mvcport:80 --name mono-jexus-mono-mvc -v $(pwd)/../mvc:/var/www/default mono/jexus:mono

docker run -d -p $apiport:80 --name mono-jexus-mono-api -v $(pwd)/../api:/var/www/default mono/jexus:mono 

echo
ip addr show eth1 | awk "$1 == "inet" {split($2,ip,"/");print "MVC - Please use the browser to access this address => http://"ip[1]":""""$mvcport"""}"
echo
ip addr show eth1 | awk "$1 == "inet" {split($2,ip,"/");print "API - Please use the browser to access this address => http://"ip[1]":""""$apiport"""}"
echo
ip addr show eth1 | awk "$1 == "inet" {split($2,ip,"/");print "tiMode - Please use the browser to access this address => http://"ip[1]":""""$tiport"""}"
echo

docker run --rm -ti -p $tiport:80 -v $(pwd)/../api:/var/www/default mono/jexus:mono

stop.sh

#!/bin/bash

docker rm -f mono-jexus-mono-mvc mono-jexus-mono-api

mono-nginx(fastcgi)

Dockerfile

FROM seif/mono

MAINTAINER Seif Attar 

ADD service/ /etc/service/
ADD config/runit/1 /etc/runit/1
ADD config/runit/1.d/cleanup-pids /etc/runit/1.d/cleanup-pids
ADD config/runit/2 /etc/runit/2
ADD runit_bootstrap /usr/sbin/runit_bootstrap

RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list 
    && apt-get update 
    && apt-get install runit nginx mono-fastcgi-server4 -y --no-install-recommends 
    && apt-get clean 
    && rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/* 
    && mkdir -p /etc/mono/registry /etc/mono/registry/LocalMachine 
    && find /etc/service/ -name run -exec chmod u+x {} ; 
    && chmod u+x /usr/sbin/runit_bootstrap;

ADD config/default /etc/nginx/sites-available/
ADD config/fastcgi_params /etc/nginx/
ADD runit_bootstrap /usr/sbin/runit_bootstrap
EXPOSE 80

start.sh

#!/bin/bash

./stop.sh

mvcport="11152"
apiport="11154"

path="/var/www:ro"
image="--restart always mono/nginx:latest"
cmd="/usr/sbin/runit_bootstrap"

docker run -d -p $mvcport:80 -v $(pwd)/../mvc:$path --name mono-nginx-mvc $image $cmd

docker run -d -p $apiport:80 -v $(pwd)/../api:$path --name mono-nginx-api $image $cmd

echo
ip addr show eth1 | awk "$1 == "inet" {split($2,ip,"/");print "MVC - Please use the browser to access this address => http://"ip[1]":""""$mvcport"""}"
echo
ip addr show eth1 | awk "$1 == "inet" {split($2,ip,"/");print "API - Please use the browser to access this address => http://"ip[1]":""""$apiport"""}"
echo

stop.sh

#!/bin/bash

docker rm -f mono-nginx-mvc mono-nginx-api

測(cè)試結(jié)果

鏡像大?。?/p>

REPOSITORY       TAG       SIZE        DESCRIPTION
mono/jexus       latest    637.2 MB    FROM mono,install jexus
jexus/mono       debian    170.8 MB    FROM debian,install jexus with mono runtime
jexus/debian     latest    127.2 MB    FROM debian,install jexus
mono/jexus       mono      674.3 MB    FROM mono,install jexus with mono runtime
nginx            latest    182.6 MB    FROM debian,install nginx(official)
mono/nginx       latest    480.9 MB    FROM seif/mono,install nginx
mono(official)   latest    628.6 MB    FROM debian:wheezy,install mono 4.4.0.182
mono(seif/mono)  latest    153.7 MB    FROM debian,install mono 4.0

Web部署及訪問(wèn)正常的方式:
jexus-mono:debian-d); nginx:latest-d);

Exe部署運(yùn)行正常的方式:
mono(official)-d) ; mono(seif/mono)-d);

MVC部署及訪問(wèn)正常的方式:
mono-jexus:latest-ti);mono-nginx(fastcgi)-d);

API部署及訪問(wèn)正常的方式:

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/39319.html

相關(guān)文章

  • Mono、Nginx、Jexus組合測(cè)試

    摘要:因?yàn)橐獙⑵脚_(tái)和應(yīng)用化,需要測(cè)試并選擇部署工具及方式。頁(yè)面部署獨(dú)立版相關(guān)部署獨(dú)立版說(shuō)明獨(dú)立版是指將的集成進(jìn)來(lái)的,據(jù)說(shuō)使用上跟差不多。接下來(lái)新建文件夾點(diǎn)擊下載打包好的文件文件中的文件夾分別用于存放要部署的三類(lèi)文件。 因?yàn)橐獙⑵脚_(tái)和應(yīng)用Docker化,需要測(cè)試并選擇部署工具及方式。 頁(yè)面部署:Nginx;Jexus;Jexus獨(dú)立版; .Net相關(guān)(MVC、API、exe)部署:Mono ...

    劉福 評(píng)論0 收藏0
  • 搭建同時(shí)支持PHP和ASP.NET的Linux服務(wù)器環(huán)境

    摘要:我的服務(wù)器安裝的是最新版,上面的代碼貼的是參考文章的原文。換成域名或者服務(wù)器,測(cè)試結(jié)果應(yīng)該為載入頁(yè)面時(shí)到服務(wù)器的連接被重置?;鸷藭r(shí)測(cè)試結(jié)果應(yīng)該為默認(rèn)頁(yè)此時(shí)測(cè)試結(jié)果應(yīng)該為的默認(rèn)頁(yè),或者是報(bào)出的錯(cuò)誤。個(gè)人認(rèn)為,避免和混用才是上上策。 注:本文只是個(gè)人研究以及探索的方法,可能不太嚴(yán)謹(jǐn),如果犯了什么專(zhuān)業(yè)性的錯(cuò)誤,還希望各位看官加以指正,謝謝。(′?ω?`) 特別感謝:闊空晴云(每次遇到什么...

    王軍 評(píng)論0 收藏0
  • 搭建同時(shí)支持PHP和ASP.NET的Linux服務(wù)器環(huán)境

    摘要:我的服務(wù)器安裝的是最新版,上面的代碼貼的是參考文章的原文。換成域名或者服務(wù)器,測(cè)試結(jié)果應(yīng)該為載入頁(yè)面時(shí)到服務(wù)器的連接被重置。火狐此時(shí)測(cè)試結(jié)果應(yīng)該為默認(rèn)頁(yè)此時(shí)測(cè)試結(jié)果應(yīng)該為的默認(rèn)頁(yè),或者是報(bào)出的錯(cuò)誤。個(gè)人認(rèn)為,避免和混用才是上上策。 注:本文只是個(gè)人研究以及探索的方法,可能不太嚴(yán)謹(jǐn),如果犯了什么專(zhuān)業(yè)性的錯(cuò)誤,還希望各位看官加以指正,謝謝。(′?ω?`) 特別感謝:闊空晴云(每次遇到什么...

    wwq0327 評(píng)論0 收藏0
  • awk在刪除鏡像過(guò)程中的用法及說(shuō)明

    摘要:實(shí)際上,認(rèn)為文本文件都是結(jié)構(gòu)化的,它將每一個(gè)輸入行定義為一個(gè)記錄,行中的每個(gè)字符串定義為一個(gè)域段,域和域之間使用分割符分割。 看到一篇Docker 技巧:刪除 Docker 容器和鏡像其中提到刪除標(biāo)簽為none的鏡像的方法,其中用到了awk,就去查了下,下面舉例說(shuō)明: docker rmi $(docker images | awk $1 == && $2 == {print $3...

    lentoo 評(píng)論0 收藏0
  • Docker利用Jexus獨(dú)立版部署MVC Demo

    摘要:在獨(dú)立版出來(lái)之前都是需要采用的方式來(lái)部署項(xiàng)目。現(xiàn)在只需用獨(dú)立版就可以完成部署工作。 在Jexus獨(dú)立版出來(lái)之前都是需要采用Mono + Jexus的方式來(lái)部署Asp.NET MVC項(xiàng)目。現(xiàn)在只需用Jexus獨(dú)立版就可以完成部署工作。 Jexus部署Asp.NET需要的文件 Dockerfile FROM ubuntu:latest MAINTAINER Mongo RUN apt...

    CoreDump 評(píng)論0 收藏0

發(fā)表評(píng)論

0條評(píng)論

最新活動(dòng)
閱讀需要支付1元查看
<