From 5ea901e6ce4f7cf685eec138931fea6e277e6fdc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Torma=20Krist=C3=B3f?= <tormakristof@tormakristof.eu>
Date: Tue, 12 Nov 2019 16:39:52 +0100
Subject: [PATCH] init

---
 .travis.yml      | 20 ++++++++++++++++++++
 Dockerfile       | 15 +++++++++++++++
 README.md        |  4 ++++
 app.py           | 10 ++++++++++
 requirements.txt |  1 +
 5 files changed, 50 insertions(+)
 create mode 100644 .travis.yml
 create mode 100644 Dockerfile
 create mode 100644 app.py
 create mode 100644 requirements.txt

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..d99adf7
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,20 @@
+language: python
+dist: bionic
+cache: pip
+
+services:
+ - docker
+
+install:
+ - pip3 install pylint bandit mccabe
+ - pip3 install -r requirements.txt
+
+before_script:
+ - find . -name "*.py" -exec python3 -m py_compile '{}' \;
+ - find . -name "*.py" -exec pylint '{}' + || if [ $? -eq 1 ]; then echo "you fail"; fi
+ - find . -name "*.py" -exec python3 -m mccabe --min 3 '{}' + || if [ $? -eq 1 ]; then echo "you fail"; fi
+ - bandit -r .
+
+script:
+  - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
+  - docker build -t="$TRAVIS_REPO_SLUG:$TRAVIS_BUILD_NUMBER" . && docker push "$TRAVIS_REPO_SLUG:$TRAVIS_BUILD_NUMBER"
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..e06d1d2
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,15 @@
+FROM python:3
+
+WORKDIR /app
+
+COPY requirements.txt
+
+RUN pip3 install -r requirements.txt
+
+COPY . .
+
+EXPOSE 8080
+
+VOLUME /data
+
+CMD ["python3","app.py"]
diff --git a/README.md b/README.md
index 3fd9742..c1a87ac 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,6 @@
 # docker-eloadas
 KSZK 2019 Docker Előadás
+
+[![Build Status](https://travis-ci.com/tormachris/docker-eloadas.svg?branch=master)](https://travis-ci.com/tormachris/docker-eloadas)
+
+
diff --git a/app.py b/app.py
new file mode 100644
index 0000000..7dd9758
--- /dev/null
+++ b/app.py
@@ -0,0 +1,10 @@
+from flask import Flask
+app = Flask(__name__)
+
+@app.route("/")
+    def readfile():
+	with open("/data/file.txt",'r') as inputfile:
+	        return inputFile.readline()
+
+if __name__ == "__main__":
+    app.run(host='0.0.0.0', port=8080)
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..7e10602
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1 @@
+flask
-- 
GitLab