Skip to content

Leosimetti/devops

Repository files navigation

Python application Python Docker Image

DevOps LAB 1 - Python web application

A simple one-page app that shows current time in Moscow.

image

Built With

  • Python
  • Flask
  • Jinja2
  • Gevent
  • pytest
  • pylint/Dockerfile Linter

Live Demo

Live Demo Link

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

Install python and pip

$ sudo apt install python3 python3-pip python3-venv

Setup

$ git clone https://github.com/Leosimetti/devops
$ cd devops

Install

$ cd app_python
$ python3 -m venv venv
$ source venv/bin/activate
$ pip3 install -r requirements.txt

Usage

Set the PORT and HOST_IP environmental variables to the desired values

$ cd app_python
$ pyhton3 main.py

By default, the application will be available at http://localhost:5000

Docker

Run in Docker

$ docker pull leosimonetti/devops-lab1-flask
$ docker run -p 5000:5000 leosimonetti/devops-lab1-flask

Build and run

$ cd app_python
$ docker build --tag clock_app --target build .
$ docker run -p 5000:5000 clock_app

Unit testing

Run tests

$ cd app_python
$ pytest

Run tests in Docker

$ cd app_python
$ docker build --target test .

Author

👤 Vitaliy Korbashov, BS18-SE-01

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published