Quickie: deploy a Go web app on Oracle Cloud
You can also check out a previous blog using Golang on Oracle Application Container Cloud with Event Hub (Kafka) and MySQL cloud
the nitty gritty…
Here is the code on Github
Contribute to accs-golang-beego-quickstart development by creating an account on GitHub.
To be honest, there is hardly anything to speak of as far as the code is concerned.. All we do is create a new Beego project using bee tool and run it — all the heavy lifting is done in a start up script!
go get github.com/astaxie/beego
echo "got beego"go get github.com/beego/bee
echo "bee tool installed"bee new accsbeego
echo "new project bootstrapped!"cd src/accsbeego
sed -i -e ‘s/8080/$PORT/g’ conf/app.conf
echo "updated conf to pick up PORT from container"bee run
bee tooldependencies are pulled
- bootstrap a new beego project (using
- modify the (auto generated)
app.conffile to replace
appname = accsbeego
httpport = $PORT //defaulted to 8080 before modification
runmode = dev
We make sure that
- we point
GOPATHto the location which App Container Cloud uses to store the artifacts i.e. refrenced by the
- we tweak the
PATHto include the previously installed
- .. and the
topology— in this case its 1 instance with 1 GB memory
We just invoke our startup script and specify the Golang version (
1.8.3 in this case)
"command": "sh start.sh",
"notes": "ACCS Beego quickstart"
Deploy to cloud
Before you begin…
git clone https://github.com/abhirockzz/accs-golang-beego-quickstart.git
- Create a zip to include
With Oracle Application Container Cloud, you have multiple options in terms of deploying your applications. This blog will demonstrate the console as well as PSM CLI (which is a powerful command line interface for managing Oracle Cloud services)
Use the console
Navigate to the main page in Oracle Application Container Cloud and click Create Application to get started
Choose the runtime — Go
- app name
- upload archive (zip) file and deployment.json
Use PaaS Service Manager CLI
Download and setup PSM CLI on your machine (using
psm setup) — details here
deploy the application —
psm accs push -n ACCSGoBeegoSample -r golang -e dockerhub -s hourly -d deployment.json -p accs-beego.zip
- we reference the zip file (using
-p) and the deployment descriptors (
- include the runtime name (
-r golang) and the fact that its sourced from Docker Hub (with
That’s it — the app creation should get initiated !
.. and you can see it’s details once the deployment completes
Check out your application
Click on the application URL and it should lead you to the app home page
Ok that wasn’t ground breaking, but look at the bright side — you now have a Golang web app running on Oracle Application Container Cloud!
Don’t forget to…
- check out the tutorials for Oracle Application Container Cloud — there is something for every runtime!
Oracle Application Container Cloud Service — Create Your First Applications
Tutorials for Oracle Application Container Cloud Service. Learn to create your first applications.
- other blogs on Application Container Cloud
Latest stories and news about App Container Cloud — Medium
Read the latest writing about App Container Cloud. Every day, thousands of voices read, write, and share important…
The views expressed in this post are my own and do not necessarily reflect the views of Oracle.