Install status site official debian package - control tool.
Status site is designed with swarm in mind.
The preferred way to deploy the system is using `docker stack deploy` command.
* Make sure you have `docker`[installed](https://docs.docker.com/engine/installation/) and `docker-compose`[installed](https://docs.docker.com/compose/install/).
The stack requires one secret - [app config](/configuration/).
You may download up-to-date example config file [here](https://git.dbogatov.org/dbogatov/status-site/-/jobs/artifacts/master/raw/appsettings.production.yml?job=release-app-docs).
Please, refer to [Configuration section](/configuration/) for config explanation.
Once you have the config (eq. `appsettings.production.yml`), run this command `docker secret create appsettings.production.yml appsettings.production.yml`
!!! warning
PostgreSQL database connection string is hardwired into the application.
It may be changed, though, by manually editing `appsettings.yml` and `docker-compose.yml`.
The security relies on internal docker network created for the stack, so nobody can even access database from the outside.
See up-to-date connection string in [Configuration section](/configuration/).
!!! note
The `e` parameter in `bash -s -- -e` specifies that you want to use example configuration.
Example configuration is conservative - most of the features are disabled, but is still enough for a basic operation of the app.
If you want to change configuration, modify `appsettings.yml` and re-run the command without `-e` argument, otherwise it will override your changes to default example configuration.
`docker-compose.yml` is not intended to be modified.
Download latest version [here](https://git.dbogatov.org/dbogatov/status-site/-/jobs/artifacts/master/raw/docker-compose.yml?job=release-app-docs)
## appsettings.yml and .env
At this point, you are ready to deploy the stack!
There are 4 mandatory files that need to be in the directory alongside with `docker-compose.yml`, so that the app can start.
`appsettings.yml` is the main configuration file, see more in [Configuration](/configuration/).
`.env` file is simply a collection of environmental variables for composition.
Its content is self-explanatory, except for `DOTNET_TAG` which needs to point to the branch you want to use (*master* by default).
#!bash
docker stack deploy --compose-file docker-compose.yml status
POSTGRES_DB=statussite
POSTGRES_USER=statususer
POSTGRES_PASSWORD=SomethingWeird15
If you want to serve the website on the node where you are deploying the stack, open up ports for **nginx** service of the stack **after** you deploy the stack.
DOTNET_TAG=master
#!bash
docker service update status_nginx --publish-add 80:80
!!! warning
Environmental variables define database connection settings which you will use in `appsettings.yml`.
For example, for the above env variables, this would be an appropriate database connection string.
If you want to add stack to an existing docker network, run the following
docker service update status_nginx --network-add my-overlay
## Manual deployment
You are all set!
Run `docker stack services status` to verify your deployment.
Application is packaged as a collection of docker images with the `docker-compose.yml` file, which knows how to orchestrate those images, and a couple of config files.
!!! tip
Debian package is under construction, which will automate these tasks for you.
Manual deployment procedure is as follows:
## Other deployment strategies (on you own risk)
* Download artifacts archive from [GitLab](https://git.dbogatov.org/dbogatov/status-site).
* Extract its contents.
* Create `appsettings.yml` and `.env`, or use example files (renaming $1.example to $1).
* Stop app if it is running - `docker-compose -p statussite stop`.
!function(e,n,t){functionr(e,n){returntypeofe===n}functiono(e){varn=x.className,t=C._config.classPrefix||"";if(b&&(n=n.baseVal),C._config.enableJSClass){varr=newRegExp("(^|\\s)"+t+"no-js(\\s|$)");n=n.replace(r,"$1"+t+"js$2")}C._config.enableClasses&&(n+=""+t+e.join(""+t),b?x.className.baseVal=n:x.className=n)}functioni(e,n){if("object"==typeofe)for(vartine)_(e,t)&&i(t,e[t]);else{varr=(e=e.toLowerCase()).split("."),s=C[r[0]];if(2==r.length&&(s=s[r[1]]),void0!==s)returnC;n="function"==typeofn?n():n,1==r.length?C[r[0]]=n:(!C[r[0]]||C[r[0]]instanceofBoolean||(C[r[0]]=newBoolean(C[r[0]])),C[r[0]][r[1]]=n),o([(n&&0!=n?"":"no-")+r.join("-")]),C._trigger(e,n)}returnC}functions(e,n){return!!~(""+e).indexOf(n)}functionf(){return"function"!=typeofn.createElement?n.createElement(arguments[0]):b?n.createElementNS.call(n,"http://www.w3.org/2000/svg",arguments[0]):n.createElement.apply(n,arguments)}functiona(){vare=n.body;returne||((e=f(b?"svg":"body")).fake=!0),e}functionl(e,t,r,o){vari,s,l,u,p="modernizr",d=f("div"),c=a();if(parseInt(r,10))for(;r--;)(l=f("div")).id=o?o[r]:p+(r+1),d.appendChild(l);returni=f("style"),i.type="text/css",i.id="s"+p,(c.fake?c:d).appendChild(i),c.appendChild(d),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(n.createTextNode(e)),d.id=p,c.fake&&(c.style.background="",c.style.overflow="hidden",u=x.style.overflow,x.style.overflow="hidden",x.appendChild(c)),s=t(d,e),c.fake?(c.parentNode.removeChild(c),x.style.overflow=u,x.offsetHeight):d.parentNode.removeChild(d),!!s}functionu(e){returne.replace(/([A-Z])/g,function(e,n){return"-"+n.toLowerCase()}).replace(/^ms-/,"-ms-")}functionp(n,r){varo=n.length;if("CSS"ine&&"supports"ine.CSS){for(;o--;)if(e.CSS.supports(u(n[o]),r))return!0;return!1}if("CSSSupportsRule"ine){for(vari=[];o--;)i.push("("+u(n[o])+":"+r+")");returni=i.join(" or "),l("@supports ("+i+") { #modernizr { position: absolute; } }",function(e){return"absolute"==getComputedStyle(e,null).position})}returnt}functiond(e){returne.replace(/([a-z])-([a-z])/g,function(e,n,t){returnn+t.toUpperCase()}).replace(/^-/,"")}functionc(e,n,o,i){functiona(){u&&(deletez.style,deletez.modElem)}if(i=!r(i,"undefined")&&i,!r(o,"undefined")){varl=p(e,o);if(!r(l,"undefined"))returnl}for(varu,c,h,m,v,g=["modernizr","tspan"];!z.style;)u=!0,z.modElem=f(g.shift()),z.style=z.modElem.style;for(h=e.length,c=0;c<h;c++)if(m=e[c],v=z.style[m],s(m,"-")&&(m=d(m)),z.style[m]!==t){if(i||r(o,"undefined"))returna(),"pfx"!=n||m;try{z.style[m]=o}catch(e){}if(z.style[m]!=v)returna(),"pfx"!=n||m}returna(),!1}functionh(e,n){returnfunction(){returne.apply(n,arguments)}}functionm(e,n,t){varo;for(variine)if(e[i]inn)return!1===t?e[i]:(o=n[e[i]],r(o,"function")?h(o,t||n):o);return!1}functionv(e,n,t,o,i){vars=e.charAt(0).toUpperCase()+e.slice(1),f=(e+""+P.join(s+"")+s).split("");returnr(n,"string")||r(n,"undefined")?c(f,n,o,i):(f=(e+""+j.join(s+"")+s).split(""),m(f,n,t))}functiong(e,n,r){returnv(e,t,t,n,r)}vary=[],w={_version:"3.3.1",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,n){vart=this;setTimeout(function(){n(t[e])},0)},addTest:function(e,n,t){y.push({name:e,fn:n,options:t})},addAsyncTest:function(e){y.push({name:null,fn:e})}},C=function(){};C.prototype=w,C=newC;var_,S=[],x=n.documentElement,b="svg"===x.nodeName.toLowerCase();!function(){vare={}.hasOwnProperty;_=r(e,"undefined")||r(e.call,"undefined")?function(e,n){returnnine&&r(e.constructor.prototype[n],"undefined")}:function(n,t){returne.call(n,t)}}(),w._l={},w.on=function(e,n){this._l[e]||(this._l[e]=[]),this._l[e].push(n),C.hasOwnProperty(e)&&setTimeout(function(){C._trigger(e,C[e])},0)},w._trigger=function(e,n){if(this._l[e]){vart=this._l[e];setTimeout(function(){vare;for(e=0;e<t.length;e++)(0,t[e])(n)},0),deletethis._l[e]}},C._q.push(function(){w.addTest=i});varP=w._config.usePrefixes?"Moz O ms Webkit".split(""):[];w._cssomPrefixes=P;varT={elem:f("modernizr")};C._q.push(function(){deleteT.elem});varz={style:T.elem.style};C._q.unshift(function(){deletez.style});varj=w._config.usePrefixes?"Moz O ms Webkit".toLowerCase().split(""):[];w._domPrefixes=j,w.testAllProps=v,w.testAllProps=g;vark=w.testStyles=l,E="CSS"ine&&"supports"ine.CSS,N="supportsCSS"ine;C.addTest("supports",E||N),C.addTest("csstransforms3d",function(){vare=!!g("perspective","1px",!0),n=C._config.usePrefixes;if(e&&(!n||"webkitPerspective"inx.style)){vart;C.supports?t="@supports (perspective: 1px)":(t="@media (transform-3d)",n&&(t+=",(-webkit-transform-3d)")),k("#modernizr{width:0;height:0}"+(t+="{#modernizr{width:7px;height:18px;margin:0;padding:0;border:0}}"),function(n){e=7===n.offsetWidth&&18===n.offsetHeight})}returne}),function(){vare,n,t,o,i,s;for(varfiny)if(y.hasOwnProperty(f)){if(e=[],(n=y[f]).name&&(e.push(n.name.toLowerCase()),n.options&&n.options.aliases&&n.options.aliases.length))for(t=0;t<n.options.aliases.length;t++)e.push(n.options.aliases[t].toLowerCase());for(o=r(n.fn,"function")?n.fn():n.fn,i=0;i<e.length;i++)1===(s=e[i].split(".")).length?C[s[0]]=o:(!C[s[0]]||C[s[0]]instanceofBoolean||(C[s[0]]=newBoolean(C[s[0]])),C[s[0]][s[1]]=o),S.push((o?"":"no-")+s.join("-"))}}(),o(S),deletew.addTest,deletew.addAsyncTest;for(varq=0;q<C._q.length;q++)C._q[q]();e.Modernizr=C}(window,document);