Giter Site home page Giter Site logo

servers-0.1.0's Introduction

Servers

Application that list servers. Data are fixed and application does not use database as a storage.

Dockerfile contains two runtime stages:

  • appServerRuntime - Spring Boot application server that provides REST API.
  • appWebServerRuntime - Spring Boot application that provides REST API and contains Angular front-end web application

BuildKit is used for building container images.

In order to build appServerRuntime image run the following command (Dockerfile has to be in current working directory):

DOCKER_BUILDKIT=1 docker build --target appServerRuntime -t danijelradakovic/servers:0.1.0 .

In order to build appWebServerRuntime image run the following command (Dockerfile has to be in current working directory):

DOCKER_BUILDKIT=1 docker build --target appWebServerRuntime -t danijelradakovic/servers:0.1.0-web .

appServerRuntime Instructions (Spring Boot REST API)

Start Docker Daemon: If you're using Docker for Windows, Then simply start the desktop app installed in:

C:\Program Files\Docker\Docker\Docker Desktop.exe

Position yourself in the folder where dockerfile is

cd DOCKERFILE_PATH

Create Docker image from Dockerfile with Docker BuildKit (Generating .jar binary file; .jar file is not already generated, so we need to map source code to .jar file)

docker image build --target DOCKERFILE_STAGE -t DOCKER_HUB_USERNAME/IMAGE_NAME:VERSION DOCKERFILE_PATH
docker image build --target appServerRuntime -t danijelradakovic/servers:0.1.0 .

Creates and runs Docker containers (Interactive mode; Container port forwarding)

docker run -MODE --name CONTAINER_NAME -p HOST_PORT:CONTAINER_PORT IMAGE_NAME
docker run -MODE --name CONTAINER_NAME -p PUBLISHED_PORT:EXPOSED_PORT IMAGE_NAME
docker run -it --name servers-0.1.0 -p 9000:8080 danijelradakovic/servers:0.1.0

Request: GET http://localhost:9000/api/server

http://localhost:9000/api/server

Response:

[
{"id":0,"hostname":"database","domain":"db.aws.com","os":"LINUX"},
{"id":1,"hostname":"sftp","domain":"sftp.aws.com","os":"LINUX"},
{"id":2,"hostname":"datalake","domain":"s3.aws.com","os":"LINUX"}
]

appWebServerRuntime Instructions (Spring Boot REST API + Angular front-end)

Start Docker Daemon: If you're using Docker for Windows, Then simply start the desktop app installed in:

C:\Program Files\Docker\Docker\Docker Desktop.exe

Position yourself in the folder where dockerfile is

cd DOCKERFILE_PATH

servers-0.1.0's People

Contributors

dusanstevic avatar

Watchers

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