diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..4b08971 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,18 @@ +--- +matrix: + include: + - IMAGE: 3.8-buster + TOXENV: py38 + - IMAGE: 3.8-buster + TOXENV: lint + - IMAGE: 3.8-buster + TOXENV: sort + - IMAGE: 3.8-buster + TOXENV: format + +pipeline: + build: + image: python:${IMAGE} + commands: + - pip install tox + - tox -e ${TOXENV} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ca15349 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +*.egg-info/ +*.pyc +.coverage +.eggs/ +.mypy_cache/ +.tox/ +.venv/ +__pycache__ +build/ +dist/ +pip-wheel-metadata/ +documentation/build/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..571de16 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3.8-alpine + +WORKDIR /app + +ADD . /app + +RUN pip install -r requirements.txt + +CMD ["python", "magic_app/app.py"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7ad377b --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +build: + @docker build -t autonomic/magicapp . + +run: + @docker run --rm -p 5000:5000 autonomic/magicapp + +publish: + @docker push autonomic/magicapp:v0.1.0 + +.PHONY: build run diff --git a/README.md b/README.md index c448a0c..12489ff 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,18 @@ # The Magic App A swarm of dreams. + +## Go Go Go No Docker + +```bash +$ python3 -m venv .venv && source .venv/bin/activate +$ pip install -r requirements.txt +$ python run.py +``` + +## Go Go Go Yes Docker + +```bash +$ make build +$ make run +``` diff --git a/magic_app/app.py b/magic_app/app.py new file mode 100644 index 0000000..c0712e9 --- /dev/null +++ b/magic_app/app.py @@ -0,0 +1,14 @@ +"""The Magic App.""" + +from flask import Flask, render_template + +app = Flask(__name__) + + +@app.route("/") +def home(): + return render_template("index.html") + + +if __name__ == "__main__": + app.run(host="0.0.0.0") diff --git a/magic_app/templates/index.html b/magic_app/templates/index.html new file mode 100644 index 0000000..9f1d967 --- /dev/null +++ b/magic_app/templates/index.html @@ -0,0 +1,11 @@ + + +
+ + +