GithubHelp home page GithubHelp logo

calculator's Introduction

CALCULATOR APP FOR DEVOPS

DATABASE SCHEMA

CREATE TABLE calculations
(
id SERIAL PRIMARY KEY,
n1 DOUBLE PRECISION NOT NULL,
n2 DOUBLE PRECISION NOT NULL,
operation CHAR(1) NOT NULL,
result DOUBLE PRECISION NOT NULL,
calculated_at TIMESTAMP NOT NULL DEFAULT NOW()
);

CONNECTION STRING

docker-compose.yml requires a connection string, this application has been designed with use of elephantSQL in mind. Therefore, Utilities.cs may need to be altered if a different source is used.

DOCKER-COMPOSE

As this application is built with the idea of being a console based calculator, docker-compose is not great for that. In order to use the calculator as intended, the command

docker-compose run mycalculator

instead of the normal usage, being docker-compose up

App in a container

navigate to the app directory in the console and input docker build -t calculator .

The -t option is used to tage the image and the period at the end instructs docker to user the file in the current directory. Next run:

docker run -it -e "pgconn={YOUR CONNECTION STRING} --name calc calculator

A breakdown of this command: -it is for running the container in interactive mode -e is setting environment variables --name {container name} {image name}

App without docker

This application can also be used without docker. Navigate to the app directory and set your connection string with the command

export pgconn={YOUR CONNECTION STRING HERE} and

dotnet run in the console and it will work there as well!

ENJOY THE MATH!

calculator's People

Contributors

donhundley avatar

Watchers

 avatar

Forkers

easv-devops

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.