简体   繁体   English

Rails托管小照片应用程序

[英]Rails hosting for small photo app

I'm making a small photo-gallery app. 我正在制作一个小型照相馆应用程序。 The photos will be hosted locally. 这些照片将在本地托管。 Right now I use dreamhost but their rails implementation looks horrible. 现在,我使用dreamhost,但是它们的rails实现看起来很糟糕。 So I'm looking for other options. 所以我在寻找其他选择。 I know Heroku gives you one 'web dyno' for free, but they don't say anything about how much space you get. 我知道Heroku免费为你提供一个'web dyno',但是他们没有说你有多少空间。 As I said, I want my photos stored locally with the app, I don't want to deal with s3 or other cloud storage. 就像我说的那样,我想将照片与应用程序一起存储在本地,而不希望处理s3或其他云存储。

there is no local storage with heroku - only temporary space. heroku没有本地存储 - 只有临时空间。 you'll need to use S3 or some off-site storage with heroku. 您需要在Seroku中使用S3或一些异地存储。

(and I agree, rails on DH is awful, even if you enable passenger) (我同意,即使您启用乘客,DH上的导轨也很糟糕)

Use Openshift to deploy your app checkout this deploying rails app in openshift 使用Openshift部署您的应用程序以在openshift中签出此部署Rails应用程序

openshift provides one permanent data directory to store data and its free openshift提供了一个永久数据目录来存储数据及其免费的

If you are interested in VPS, Digital Ocean - https://www.digitalocean.com/ , provides excellent hosting starting from $5. 如果您对VPS感兴趣,数字海洋 - https://www.digitalocean.com/ ,提供优惠的托管服务,起价5美元起。 And you can store your photos on the local disc. 您可以将照片存储在本地光盘上。

There are very good tutorials on their site to get you started with. 在他们的网站上有很好的教程可以帮助您入门。

查看Shelly Cloud: https : //shellycloud.com/您将获得持久存储(因此在磁盘出现故障时不会丢失数据),并且该部署针对Rails应用程序进行了优化。

With Heroku you can host images that you store in the repository of your project. 使用Heroku,您可以托管存储在项目存储库中的图像。 Just try this: 试试这个:

rails new mytest

create a simple page and link to a test image in your /app/assets/images 创建一个简单的页面并链接到/app/assets/images的测试/app/assets/images

heroku create mytest123  # <-- mytest1234 must be your unique app name

and now push the repo to Heroku: 现在将回购推送到Heroku:

git push origin master  # origin points automatically to Heroku after you created this

This is the easiest way to host small projects for free. 这是免费托管小项目的最简单方法。 Sometimes the Dyno takes some time to startup, and you need to point the domain to the right proxy, but these issues can be dealt with later. 有时Dyno需要一些时间才能启动,并且您需要将域指向正确的代理,但是以后可以解决这些问题。

S3 comes into play when you deal with uploaded content / images. S3处理上传的内容/图像时会发挥作用。 For this use case, you need S3 which is out of the scope of your question too. 对于此用例,您需要的S3也不属于您的问题范围。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM