diff --git a/infra/app.yaml b/infra/app.yaml new file mode 100644 index 00000000..7b36fe2b --- /dev/null +++ b/infra/app.yaml @@ -0,0 +1,2 @@ +runtime: python310 +service: backend diff --git a/infra/cloudbuild.yaml b/infra/cloudbuild.yaml new file mode 100644 index 00000000..52699ab6 --- /dev/null +++ b/infra/cloudbuild.yaml @@ -0,0 +1,28 @@ +steps: + - name: ubuntu + entrypoint: bash + args: + - '-c' + - | + apt update + apt install python3 python3-pip -y + pip3 install poetry + poetry export >| requirements.txt + + - name: ubuntu + entrypoint: bash + args: + - '-c' + - | + printenv >| .env + env: + - 'TYPESENSE_API_KEY=${_TYPESENSE_API_KEY}' + - 'SECRET_KEY=${_SECRET_KEY}' + - 'DEBUG=0' + + - name: python + entrypoint: pip + args: [ "install", "-r", "requirements.txt" ] + + - name: "gcr.io/cloud-builders/gcloud" + args: [ "app", "deploy", "--appyaml=infra/app.yaml" ] diff --git a/infra/dispatch.yaml b/infra/dispatch.yaml new file mode 100644 index 00000000..47d5ec99 --- /dev/null +++ b/infra/dispatch.yaml @@ -0,0 +1,4 @@ +# I'm not sure why I needed this for my DNS to work, but I'll keep it just in case +dispatch: + - url: "backend.sora-reader.app/*" + service: backend diff --git a/main.py b/main.py new file mode 100644 index 00000000..cbed7113 --- /dev/null +++ b/main.py @@ -0,0 +1,3 @@ +from manga_reader.wsgi import application + +app = application