Initial files
This commit is contained in:
parent
92f55f4509
commit
8aade76b9e
|
@ -0,0 +1,2 @@
|
|||
.env
|
||||
.vscode
|
|
@ -0,0 +1,11 @@
|
|||
FROM python:slim
|
||||
|
||||
|
||||
RUN pip install aiohttp
|
||||
|
||||
|
||||
COPY src /src
|
||||
COPY test /test
|
||||
|
||||
CMD [ "python", "/src/main.py"]
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
version: "3.7"
|
||||
|
||||
services:
|
||||
webhook:
|
||||
build: ./
|
||||
image: webhook
|
||||
container_name: webhook
|
||||
networks:
|
||||
- caddy
|
||||
restart: unless-stopped
|
||||
labels:
|
||||
caddy: ${DOMAIN}
|
||||
caddy.tls: ${EMAIL}
|
||||
caddy.reverse_proxy: "{{upstreams 8080}}"
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "1m"
|
||||
tty: true
|
||||
|
||||
networks:
|
||||
caddy:
|
||||
external: true
|
|
@ -0,0 +1,14 @@
|
|||
from aiohttp import web
|
||||
|
||||
async def handle(request):
|
||||
name = request.match_info.get('name', "Anonymous")
|
||||
text = "Hello, " + name
|
||||
return web.Response(text=text)
|
||||
|
||||
app = web.Application()
|
||||
app.add_routes([web.get('/', handle),
|
||||
web.get('/{name}', handle)])
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("Starting")
|
||||
web.run_app(app)
|
Loading…
Reference in New Issue