"use strict";(self.webpackChunkgoffee_site=self.webpackChunkgoffee_site||[]).push([[4990],{5024:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>u,frontMatter:()=>r,metadata:()=>s,toc:()=>c});var i=t(4848),o=t(8453);const r={title:"Build static"},a=void 0,s={id:"buildstatic",title:"Build static",description:"Check your app",source:"@site/docs/buildstatic.md",sourceDirName:".",slug:"/buildstatic",permalink:"/goffee/docs/buildstatic",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{title:"Build static"},sidebar:"docsSidebar",previous:{title:"Contribute",permalink:"/goffee/docs/contribute"},next:{title:"Sample server",permalink:"/goffee/docs/server"}},l={},c=[{value:"Check your app",id:"check-your-app",level:3},{value:"Build binary",id:"build-binary",level:3}];function d(e){const n={code:"code",h3:"h3",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h3,{id:"check-your-app",children:"Check your app"}),"\n",(0,i.jsx)(n.p,{children:"To deploy the application in production mode, navigate to the project directory and run the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"goffee run:prod\n"})}),"\n",(0,i.jsxs)(n.p,{children:["In this mode, the application will use the configuration file ",(0,i.jsx)(n.code,{children:".env"}),".\nThen you can test if everything is running as planned, if your environment settings are correct, etc."]}),"\n",(0,i.jsx)(n.h3,{id:"build-binary",children:"Build binary"}),"\n",(0,i.jsx)(n.p,{children:"To build a binary Linux compatible, navigate to the project directory and compile using the standard Golang command."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"GOOS=linux GOARCH=amd64 go build -o nameofyourbinary\n"})}),"\n",(0,i.jsx)(n.p,{children:"This will generate a binary file that you can use to install on your production systems."}),"\n",(0,i.jsx)(n.p,{children:"Note that this binary file will look for other files and folders in the same path that you should add to your installation. The files are:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"nameofyourbinary -----------------\x3e binary compiled\n.env  ----------------------------\x3e environment variables\nstorage/ -------------------------\x3e a place to store files, \n\u251c\u2500\u2500 templates/ -------------------\x3e custom templates\n\u251c\u2500\u2500 public/ ----------------------\x3e public files without routing system\ntls/ -----------------------------\x3e tls certificates (optional)\n"})})]})}function u(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>s});var i=t(6540);const o={},r=i.createContext(o);function a(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:a(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]);