Alpha Helicopter Tours

Alpha Helicopter provides helicopter tours for events such as engagements, anniversaries, birthdays and corporate events. Our Georgia helicopter tours of Atlanta and Amicalola Falls offer…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Shipping Go to AWS in 5 Minutes

I recently had the opportunity to code at an AWS hackathon and therefore decided to deploy a Go application via docker to get started as fast as possible.

At first let’s create a lightweight docker file that we can use for deployment on AWS Elastic Beanstalk:

I was not using any dependency tools to keep things simple. The only dependencies are the echo web framework and qp a postgres connector for Go. On your AWS development console navigate to Elastic Beanstalk and create a new application by selecting docker as platform and uploading your Dockerfile:

Now we also want to create a database that we can connect to and that the application uses to provide responses. I decided to use a postgres instance. Hit “Configure more options” to configure the database for your application:

When your application is running you can access it via the URL that Elastic Beanstalk provides. The static files serving should be working fine however the /data route that tries a database Select does not work currently because we have to insert something in the database first. Therefore we have to add the following line to the security group of our database:

We can now connect via pgAdmin and create a table (in my example distributers) and insert some rows:

Connect to database via pgAdmin

If you now call the /data route you should get a nice JSON response with the data you inserted. Congrats you now have a basic application with a sidecar database running that you can use for hackathons.

Add a comment

Related posts:

Why You Must See The Himalayas At Mukteshwar

There is something elemental about the mountains which elevate most of us into another world. Seeing the mighty Himalayas up and close doesn’t always require trekking for days or driving through…

My iPad Pro Daily Driver Setup

I use my iPad Pro every day. Per Screen Time, I am on it for at least 9–10 hours a day, if not more. It is my main computer, and it has pretty much replaced my laptop. I am currently starting up my…

Snarl

During times of economic hardship, the word “Utopian” emerges, usually spat out as a curse. The idea of a harmonious social and political order has devolved into a contemptible pipedream of radicals…