Giter Site home page Giter Site logo

stockticker's Introduction

Stock Ticker

This stock ticker app queries the alpha vantage API for a given stock symbol and returns a configurable number of days data along with the average closing price. The data is cached in memory for 1 hour.

Building

The container image builds from a UBI8 build image, which downloads Go 1.17.7 and builds the stock ticker. This is then copied into a fresh UBI8 image.

To build, use buildah or podman (or docker):

buildah bud -t <your tag here> . or podman build -t <your tag here> .

To build the binary on it's own:

CGO_ENABLED=0 #optional if you want a statically compiled binary
go build -o stockticker main.go

You can also build a from scratch version (be sure to mount in your ssl certs directory containing your trusted ca bundle into /etc/ssl/certs when running):

buildah bud -f Containerfile.scratch-t <your tag here> . or podman build -f Containerfile.scratch -t <your tag here> .

Running with podman

To run this with podman (or docker), you'll need an environment file that looks like this:

NDAYS=7
SYMBOL=MSFT
APIKEY=yourkeyhere

Alternatively, you can put these on the podman command line.

With an environment file, run it like this:

podman run -d --env-file=<envfile> -p 8080:8080 <your tag here>

Running on Kubernetes

An example Kubernetes deployment manifest can be found in deployment/. This will create a stockticker namespace, a config map, a secret, the deployment, a service and an ingress. You will need to modify the secret to contain your alpha vantage API key, and the symbol to find, along with number of days of data to return, can be set in the config map.

Apply to your cluster with kubectl apply -f deployment/stockticker.yaml.

stockticker's People

Contributors

martingoldstone avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.