From 922ee388eaf0fe966d4ca0d2782c0c3569aec1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Sat, 17 Dec 2022 12:46:39 +0200 Subject: [PATCH] Prepare for Kubernetes migration --- .drone.yml | 3 +-- Dockerfile | 4 ++-- doorboy.py => app/doorboy-proxy.py | 3 +++ requirements.txt | 2 -- 4 files changed, 6 insertions(+), 6 deletions(-) rename doorboy.py => app/doorboy-proxy.py (96%) mode change 100644 => 100755 delete mode 100644 requirements.txt diff --git a/.drone.yml b/.drone.yml index d8980bc..c650ef9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,3 +1,2 @@ kind: template -load: docker.yaml - +load: docker-multiarch.yaml diff --git a/Dockerfile b/Dockerfile index f29f9d8..0b55404 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ FROM harbor.k-space.ee/k-space/microservice-base WORKDIR /app -COPY *.py ./ -CMD python doorboy.py +COPY app /app +CMD /app/doorboy-proxy.py diff --git a/doorboy.py b/app/doorboy-proxy.py old mode 100644 new mode 100755 similarity index 96% rename from doorboy.py rename to app/doorboy-proxy.py index 1be672d..1153ab3 --- a/doorboy.py +++ b/app/doorboy-proxy.py @@ -1,10 +1,13 @@ +#!/usr/bin/env python3 from sanic import Sanic from sanic.response import text, json +from sanic_prometheus import monitor from motor.motor_asyncio import AsyncIOMotorClient import pymongo import os app = Sanic(__name__) +monitor(app).expose_endpoint() DOORBOY_SECRET = os.environ["DOORBOY_SECRET"] MONGO_URI = os.getenv("MONGO_URI", diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index ff9dbc1..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -sanic -motor