Giter Club home page Giter Club logo

aaa-docker-hw's Introduction

Homework

Docker lecture repository at Avito's Analytics Academy Data Science course.

Step 1:

To understand how the application works, install the dependencies and open these urls (using curl or a browser):

curl http://127.0.0.1:8080/books
curl http://127.0.0.1:8080/authors

Then go to this url:

http://127.0.0.1:8080/metrics

Here you can see how many times you have opened /books, /authors or some other path. There is also a lot of additional information - server response time, etc.

Step 2.

Make a Dockerfile which uses python version 3.8 or higher as its base image, install dependencies and run server.py on port 8080. And after that build it with tag server:0.0.1.

Step 3.

Run the following commands:

# create network
docker network create --driver bridge webnet

# run server
docker run \
    --name=server \
    -d \
    --rm \
    -p 8080:8080 \
    --network webnet \
    server:0.0.1

# run prometheus
docker run \
    --name=prometheus \
    -v $(pwd)/prometheus.yml:/etc/prometheus/prometheus.yml \
    -d \
    --rm \
    --network webnet \
    prom/prometheus:v2.40.7

# run grafana
docker run \
     --name=grafana \
    -v $(pwd)/grafana/config.ini:/etc/grafana/grafana.ini \
    -v $(pwd)/grafana/datasource.yml:/etc/grafana/provisioning/datasources/default.yaml \
    -v $(pwd)/grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/default.yaml \
    -v $(pwd)/grafana/dashboards:/var/lib/grafana/dashboards \
    -d \
    --rm \
    -p 3000:3000 \
    --network webnet \
     grafana/grafana:9.4.2

Step 4.

Go to each url several times:

curl http://127.0.0.1:8080/books
curl http://127.0.0.1:8080/authors

Step 5.

Open grafana in your browser.

Step 6.

Make a docker-compose file.

aaa-docker-hw's People

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.