Question

I've seen the documentation on how to deploy to AWS S3 but am at a bit of a loss still (I also used this unfinished tutorial.

Do I need to setup an EC2 account? Where do I put the package.json file? Do only the out files (and package.json) need to be uploaded to Amazon? Does all of this go into the bucket MyWebsite.com?

Note - I'm new to web programming.

Was it helpful?

Solution

As you pointed out my tutorial is unfinished, but I hope it helped a little. Hopefully I can clarify a few things:

  1. You're spot on with --env static. You need to add that to everything you do with DocPad so that what you see locally is the same as what you plan to deploy. I.e. you need to use DocPad run --env static too.

  2. My 'tutorial' was on how to point AWS CloudFront at a root domain. This can be a frustrating experience particularly if you're just starting out with static sites. If you're using CloudFront, consider switching to just use S3. You can do this easily by changing the configuration in Route 53.

  3. My tutorial misses an important step; You need to create another bucket with the name of your domain with www. in front of it if you would like to use www as well as your root domain. You then configure that bucket as a website and redirect it to the bucket with your website. This is all configuration.

  4. You only need to upload everything in the out folder. package.json is not needed once the site has been generated.

  5. Check out the source to my site and copy what you need. My whole deployment to S3 is automated through Grunt.

Have fun!

OTHER TIPS

I finally found the answer to my question.

Basically what I needed to do was install the Docpad plugin cleanurls. I then needed to use the command line:

docpad generate --env static

And then upload to the AWS S3 bucket.

Here's the stack overflow answer where I gathered this information from.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top