Sign inSign up

openmedicus/hyperfastcgi

By openmedicus

Updated almost 7 years ago

CentOS container with Mono and HyperFast CGI 4

Image
0

10K+

openmedicus/hyperfastcgi repository overview

hyperfastcgi

CentOS 7 container with Mono and HyperFast CGI 4

Will allow you to run docker container with ServiceStack webservices.

Docker image is here: https://hub.docker.com/r/openmedicus/hyperfastcgi/

Pull and run

docker pull openmedicus/hyperfastcgi

Now you can run it

docker run --name=servicestack1 -d -v /www/ws1:/var/www:ro -p 9000:9000 hyperfastcgi "/applications=localhost:80:/:/var/www"

This will use your ServiceStack webservice in '/www/ws1'.

You can start multple docker container, with virtual path to "/v2":

docker run --name=servicestack2 -d -v /www/ws2:/var/www:ro -p 9001:9000 hyperfastcgi "/applications=localhost:80:/:/var/www"

Nginx
# semanage port -m -t http_port_t -p tcp 9000

upstream fastcgi_backend {
    server 127.0.0.1:9000;
    keepalive 80;
}

upstream fastcgi_backend_v2 {
    server 127.0.0.1:9001;
    keepalive 80;
}

 
server {
         listen   80;
         server_name  127.0.0.1;

         access_log   /var/log/nginx/clinic.log;
         error_log   /var/log/nginx/clinic_error.log;

         location ~ /\.  { deny all; }

         location / {
                 index Global.asax;
                 fastcgi_index Global.asax;

                 include /etc/nginx/fastcgi_params;

                 fastcgi_split_path_info ^((?U).+\.as.x)(/?.+)$;
                 fastcgi_param PATH_INFO $fastcgi_path_info;
                 fastcgi_param SCRIPT_FILENAME $request_filename;

                 fastcgi_keep_conn on;
                 fastcgi_pass fastcgi_backend;
         }

         location /v2 {
                 index Global.asax;
                 fastcgi_index Global.asax;

                 include /etc/nginx/fastcgi_params;

                 fastcgi_split_path_info ^(/v2)(/?.*)$;
                 fastcgi_param PATH_INFO $fastcgi_path_info;
                 fastcgi_param SCRIPT_FILENAME $request_filename;

                 fastcgi_keep_conn on;
                 fastcgi_pass fastcgi_backend_v2;
         }
}
Systemd

/etc/systemd/system/docker-servicestack.service

[Unit]
Description=ServiceStack Container
Requires=docker.service
After=docker.service

[Service]
Restart=always
ExecStart=/usr/bin/docker run --name=servicestack1 -v /www/ws1:/var/www:ro -p 9000:9000 docker.io/openmedicus/hyperfastcgi "/applications=localhost:80:/:/var/www"
ExecStop=/usr/bin/docker stop -t 2 servicestack1
ExecStopPost=/usr/bin/docker rm -f servicestack1

[Install]
WantedBy=default.target

Now reload systemd, enable and start

# systemctl daemon-reload
# systemctl enable docker-servicestack
# systemctl start docker-servicestack
Create your own Docker Container

Dockerfile

FROM docker.io/openmedicus/hyperfastcgi
MAINTAINER Your Name <your_name@your_domain.com>

ADD your_ws_folder /var/www/
Please comment on:

https://github.com/openmedicus/HyperFastCgiDocker

Tag summary

Content type

Image

Digest

Size

519.7 MB

Last updated

almost 7 years ago

docker pull openmedicus/hyperfastcgi