Skip to content

Latest commit

 

History

History
124 lines (69 loc) · 3.8 KB

lightsail.md

File metadata and controls

124 lines (69 loc) · 3.8 KB

Deploy LogPaste to Amazon LightSail

Amazon LightSail is an attractive option for launching LogPaste to production for two main reasons:

  • You can deploy entirely from Amazon's AWS dashboard, so you don't need to install any software.
  • You can view LogPaste's server logs directly from your AWS dashboard.
  • LightSail offers free TLS certificates for a custom domain.

The downside is that it doesn't fit within AWS's free tier, so hosting will cost $7 per month, as of this writing.

Pre-requisites

You'll need:

  • An Amazon AWS account
  • A storage bucket and IAM credentials on Amazon S3 or an S3-compatible storage service.

Create a LogPaste container

Visit Amazon LightSail's container management dashboard

LightSail management screen

Choose a Nano server with 1x scale.

LightSail server capacity screen

Click "Set up deployment" and then choose "Specify a custom deployment."

Screenshot showing where to click specify custom deployment

Enter the following information for your custom deployment:

  • Container name: Choose whatever name you want, such as yourcompany-logpaste
  • Image: mtlynch/logpaste:0.2.5 (or whatever the latest LogPaste version is)
  • Launch command: leave blank
  • Environment variables
Key Value
PORT 3001
LP_BEHIND_PROXY "y"
DB_REPLICA_URL The S3 URL of your S3 bucket
LITESTREAM_REGION The region of your S3 bucket
LITESTREAM_ACCESS_KEY_ID The AWS access key ID from your IAM credentials
LITESTREAM_SECRET_ACCESS_KEY The AWS secret access key from your IAM credentials
  • Open ports: Choose port 3001, protocol HTTP

Screenshot showing custom values for LightSail container

Under "Public Endpoint," select the container you created above:

Screenshot showing "contoso-logpaste" in dropdown menu

Choose a name for your service (it can be the same as your container name):

Screenshot showing "contoso-logpaste" as name for service

Finally, click "Create container service."

Screenshot showing "Create container service" button

Completing deployment

As LightSail deploys your image, you'll see a status of "Pending" for the container.

Screenshot showing LightSail in the process of deploying a container at the "Pending" stage

It will take LightSail about three to five minutes to deploy your instance for the first time. When deployment is complete, it will show a status of "Running."

Screenshot showing LightSail deployment complete

When your container is running, you can access it through the "Public domain" URL.

Screenshot showing how to access container's public domain URL

You can view server logs for your LogPaste instance by clicking "Open log" in the box next to your container.

Screenshot showing LightSail logs in web dashboard