This document outlines the steps to set up the infrastructure for the MarkDock application on AWS.
- An AWS account
- A domain name
- S3 bucket for storing the static files
- CloudFront distribution for serving the static files
If you don't have an AWS account, you will need to create one. You can create an account here.
You will need a domain name to point to the CloudFront distribution. You can purchase a domain name from any domain registrar.
- Go to the S3 service in the AWS console.
- Click on the
Create bucket
button. - Enter a unique bucket name and select the region.
- You will need to enable static website hosting for the bucket. To do this, go to the bucket properties and click on the
Static website hosting
tab. Enable the static website hosting and enter the index document and error document. Since we are using React Router, the index document should beindex.html
and the error document should beindex.html
. - Keep the public access settings to be on. This will allow the CloudFront distribution to access the files in the bucket.
- Create the bucket with the above settings.
- You will want to upload the build files to the bucket. You will need to upload the files and then click upload folder and select the static folder from the build folder.
- Go to the CloudFront service in the AWS console.
- Click on the
Create distribution
button. - You will want to copy the endpoint of the S3 bucket that you created earlier. This will be the origin domain name.
- Paste the origin domain name in the
Origin Domain
field. - Under Viewer, you can select the
Redirect HTTP to HTTPS
option. - Select the recommended cache policy for the distribution.
- Under Settings, you can enter the domain name that you want to use for the CloudFront distribution. This should be the domain name that you purchased earlier.
- You will also want to set up a certificate using ACM. You can request a certificate from ACM and then select the certificate for the CloudFront distribution.
- Create the distribution with the above settings.
You will need to configure the domain name to point to the CloudFront distribution. You will need to create a CNAME record in your domain registrar's DNS settings. The CNAME record should point to the domain name of the CloudFront distribution.
Here is an example of how the CNAME record should look:
Name: www.markdock.com
Type: CNAME
Value: d123456789.cloudfront.net
For the root domain (markdock.com), you will need to create a redirect to the www subdomain. This can be done using the domain registrar's settings.
Once you have completed the above steps, you should have the infrastructure set up for the MarkDock application on AWS. You can now access the application using the domain name that you configured.
If you want to setup the workflow for deploying the application directly to the S3 bucket on Github, you can follow our documentation here.