I'm looking for cloud-hosting for a Grails app. In the past, I've tried several including CloudFoundry, JElastic, AppFog, but could never successfully deploy the app. The app needs:
I'll only be using this site for QA, so am not concerned about performance. Obviously I'd like it to be as simple as possible to deploy the app, and I'd like to pay as little as possible for the hosting.
I've already tried using the CloudFoundry Grails plugin to deploy to CloudFoundry, but without any success.
I have successfully hosted Grails based websites on Amazon EC2. To reduce the cost, I used small reserved instance. I think It's ok to use Amazon EC2 AMI for temporary files such as searchable index files since you can always re-index if AMI crashes.
To store user images, I used Amazon S3 using Grails AWS SDK plugin (http://grails.org/plugin/aws-sdk). It is very easy to upload files to S3 using Amazon SDK http://blanq.github.io/grails-aws/1.2.12.1/index.html -
To Upload a file with public read permissions.
amazonWebService.s3.putObject(new PutObjectRequest('some-grails-bucket',
'somePath/someKey.jpg', new File('/Users/ben/Desktop/photo.jpg')).withCannedAcl( CannedAccessControlList.PublicRead ) )
Download a file.
amazonWebService.s3.getObject(new GetObjectRequest('some-grails-bucket',
'somePath/someKey.jpg'), new File('/Users/ben/Downloads/photo.jpg'))
Delete a file.
amazonWebService.s3.deleteObject('some-grails-bucket', 'somePath/someKey.jpg')
I hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With