Add /apps setup and spec out more targets
This commit is contained in:
parent
5852a3649f
commit
ad1d46cc2c
11
Makefile
11
Makefile
@ -1,10 +1,13 @@
|
|||||||
build:
|
python-run:
|
||||||
|
@python magic_app/app.py
|
||||||
|
|
||||||
|
docker-build:
|
||||||
@docker build -t autonomic/magicapp .
|
@docker build -t autonomic/magicapp .
|
||||||
|
|
||||||
run:
|
docker-run:
|
||||||
@docker run --rm -p 5000:5000 autonomic/magicapp
|
@docker run --rm -p 5000:5000 autonomic/magicapp
|
||||||
|
|
||||||
publish:
|
docker-publish:
|
||||||
@docker push autonomic/magicapp:v0.1.0
|
@docker push autonomic/magicapp:v0.1.0
|
||||||
|
|
||||||
.PHONY: build run
|
.PHONY: python-run docker-build docker-run docker-publish
|
||||||
|
@ -9,12 +9,12 @@ A swarm of dreams.
|
|||||||
```bash
|
```bash
|
||||||
$ python3 -m venv .venv && source .venv/bin/activate
|
$ python3 -m venv .venv && source .venv/bin/activate
|
||||||
$ pip install -r requirements.txt
|
$ pip install -r requirements.txt
|
||||||
$ python run.py
|
$ make python-run
|
||||||
```
|
```
|
||||||
|
|
||||||
## Go Go Go Yes Docker
|
## Go Go Go Yes Docker
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ make build
|
$ make docker-build
|
||||||
$ make run
|
$ make docker-run
|
||||||
```
|
```
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"""The Magic App."""
|
"""The Magic App."""
|
||||||
|
|
||||||
from flask import Flask, render_template
|
from flask import Flask, render_template, send_from_directory
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
@ -10,5 +10,10 @@ def home():
|
|||||||
return render_template("index.html")
|
return render_template("index.html")
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/apps")
|
||||||
|
def apps():
|
||||||
|
return send_from_directory("static", "apps.json")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(host="0.0.0.0")
|
app.run(host="0.0.0.0")
|
||||||
|
3
magic_app/static/apps.json
Normal file
3
magic_app/static/apps.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"gitea": "https://git.autonomic.zone/compose-stacks/gitea"
|
||||||
|
}
|
Reference in New Issue
Block a user