diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fcf366dbf8e49876958323f49846b099948cdb05..e718b38225502a4c5cf1c038ce0f462df4ab6f25 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,6 @@ repos: rev: 19.10b0 hooks: - id: black - exclude: &excluded_pythonscripts pythonrc.py|rabbitmqadmin args: - | --line-length=79 @@ -33,7 +32,6 @@ repos: rev: 3.7.9 hooks: - id: flake8 - exclude: *excluded_pythonscripts args: - |- --max-line-length=79 @@ -43,10 +41,9 @@ repos: rev: v2.4.4 hooks: - id: pylint - exclude: *excluded_pythonscripts args: - |- - --disable=R0801 + --disable=R0801,E0401 - repo: https://www.shore.co.il/git/docker-pre-commit rev: v0.3.0 hooks: diff --git a/docker-compose.yml b/docker-compose.yml index 6047329a6edc46368e1a7c9ef8b37ccc08c69a08..242dc2ba494cfec6384d4f8fa4f0a410ce155a48 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,3 +14,13 @@ services: image: rabbitmq:3.8-management-alpine ports: - 15672:15672 + server: + build: + context: ./ + command: ["flask", "run", "--port", "8080", "--host", "0.0.0.0"] + environment: + FLASK_APP: waldorf/server + healthcheck: + test: ["CMD-SHELL", "wget http://localhost:8080/ping || exit 1"] + ports: + - 8080:8080 diff --git a/waldorf/server.py b/waldorf/server.py new file mode 100644 index 0000000000000000000000000000000000000000..ee41f9714190a84a2e56675434e7032b1aa9fb81 --- /dev/null +++ b/waldorf/server.py @@ -0,0 +1,10 @@ +"""Dummy web server using Flask.""" +from flask import Flask + +app = Flask(__name__) # pylint: disable=invalid-name + + +@app.route("/ping") +def ping(): + """Healthcheck.""" + return "pong"