Deploying Yesod Web Application

I have a simple Yesod web application. I could follow the instructions at http://www.yesodweb.com/page/quickstart , and the proven stack exec -- Yesod devel working fine.

The server I use (Amazon EC2) has only one gigabyte of memory, so I cannot compile the Yesod website. I used my local machine for assembly. Both of them use Ubuntu 14.04.

From http://www.yesodweb.com/book/deploying-your-webapp I need three components to deploy to another machine.

  • Your executable file.
  • Configuration folder.
  • Static folder.

I easily find the config / static folder, but I'm not quite sure where to find the executable file (s). Besides that, how to run exeuctable without using stack exec -- Yesod devel ?

+5
source share
2 answers

The stack build gives me hints:

 my-project-0.0.0: install Installing library in /home/a/my-project/.stack-work/install/x86_64-linux/lts-3.13/7.10.2/lib/x86_64-linux-ghc-7.10.2/my-project-0.0.0-Khn8lQEgR1HARzYGStlvPe Installing executable(s) in /home/a/my-project/.stack-work/install/x86_64-linux/lts-3.13/7.10.2/bin Registering my-project-0.0.0... 

The executable file is located in /home/a/my-project/.stack-work/install/x86_64-linux/lts-3.13/7.10.2/bin . I could copy the files (executable, static, and configs) to the ~ / deployment directory to verify that Yesod works fine.

+1
source

As far as I know, the executable should be in the subdirectory of the assembly of your project directory. I think this is a hidden directory (the name starts with a dot), so you may need to run "ls -a" to see it.

To run, just execute the executable file :) (add '&' so that it runs in the background.

After you have the final version that you want to switch from, you will probably configure the executable file to run automatically when the virtual machine boots up to determine if the executable file has worked, etc.

Good luck Michal

+1
source

Source: https://habr.com/ru/post/1235723/


All Articles