CentOS container with Mono and HyperFast CGI 4
10K+
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/
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"
# 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;
}
}
/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
Dockerfile
FROM docker.io/openmedicus/hyperfastcgi
MAINTAINER Your Name <your_name@your_domain.com>
ADD your_ws_folder /var/www/
Content type
Image
Digest
Size
519.7 MB
Last updated
almost 7 years ago
docker pull openmedicus/hyperfastcgi