Deploying Yesod web app

折月煮酒 提交于 2019-11-30 17:09:47

问题


I have a simple Yesod web app. I could follow the instruction in http://www.yesodweb.com/page/quickstart, and checked stack exec -- Yesod devel is working fine.

The server that I use (Amazon EC2) has only one gigabyte of memory, so I can't compile the Yesod web. I used my local machine to build. Both of them use Ubuntu 14.04.

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

  1. Your executable.
  2. The config folder.
  3. The static folder.

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


回答1:


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

To run - simply execute the executable :) (Append '&' to make it run in the background).

Once you have the final version you wish to go into production with, you'll probably configure the executable to start automatically when the VM boots, to detect if the executable crashed, etc.

Good luck, Michał




回答2:


The stack build command gives me the 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 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 config) in ~/deployment directory to check the Yesod works fine.



来源:https://stackoverflow.com/questions/33657566/deploying-yesod-web-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!