Coder Social home page Coder Social logo

abhinabsarkar / abs-aspnetfrontendapp Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 1.11 MB

A sample docker app built on Alpine linux 3.1 version using C# dotnet core version 3.1. This demo front end application displays on its home page details of the server on which it runs, including the host name & ip address. The front end app also has a "Backend Service" page which invokes a demo API and displays the result.

Dockerfile 4.65% C# 48.03% HTML 37.07% CSS 8.78% JavaScript 1.47%

abs-aspnetfrontendapp's Introduction

Docker hub image - abhinabsarkar/abs-aspnetfrontendapp

A sample docker app built on Alpine linux 3.1 version using C# dotnet core version 3.1. This demo front end application displays on its home page details of the server on which it runs, including the host name & ip address. The front end app also has a "Backend Service" page which invokes a demo API and displays the result.

The docker image can be downloaded from docker hub by running the below command

docker pull abhinabsarkar/abs-aspnetfrontendapp:<version>

Size of the docker image is 114 MB.

The application can be run on any kubernetes cluster. A sample deployment.yaml with config map to invoke any "Backend Service" (GET API which doesn't require any parameters) can be found under the kubernetes folder.

To build the image, run docker build from the root directory of the application

# Build the abs image
docker build -t abs-aspnetfrontendapp:v1.0.0 .
# Run the docker container locally
# The release version runs the container at port 80 although the app is running at port 5000
docker run --name abs-aspnetfrontendapp-container -d -p 8002:80 abs-aspnetfrontendapp:v1.0.0
# Check the status of the container
docker ps -a | findstr abs-aspnetfrontendapp-container
# Test the app
curl http://localhost:8002
# log into the running container 
docker exec -it abs-aspnetfrontendapp-container /bin/bash
docker exec -it abs-aspnetfrontendapp-container <command>
# Remove the container
docker rm abs-aspnetfrontendapp-container -f
# Remove the image
docker rmi abs-aspnetfrontendapp:v1.0.0
# Push the image to docker hub
docker login
# Tag the local image & map it to the docker repo
docker tag local-image:tagname new-repo:tagname
# eg: docker tag abs-aspnetfrontendapp:v1.0.0 abhinabsarkar/abs-aspnetfrontendapp:v1.0.0
# push the tagged image to the docker hub
docker push new-repo:tagname
# eg: docker push abhinabsarkar/abs-aspnetfrontendapp:v1.0.0

To run the application on any Kubernetes platform (including Docker-Desktop) with ConfigMap

# Create namespace
kubectl create namespace abs
# Run the deployment config. A sample deployment config is placed under the kubernetes folder 
kubectl apply -f abs-aspnetfrontendapp.yaml -n abs
# Check the config map
kubectl describe configmap/aspnetfrontendapp -n abs
# Check if the application pod is running 
kubectl get all -n abs -o wide
# Peek into the running pod in k8s for debugging 
kubectl  -n <namespace> exec -it <pod-name> -- /bin/bash
kubectl  -n abs exec -it aspnetfrontendapp-548d449d5-h9zz7 -- /bin/bash
kubectl -n <namespace> exec --stdin --tty <pod-name> -- /bin/bash
# Delete the namespace & all the resources
kubectl delete namespace abs

abs-aspnetfrontendapp's People

Contributors

abhinabsarkar avatar

Watchers

James Cloos avatar  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.