From 903a4f42aa4a552587f7c92e82b1c3ea785bcfa7 Mon Sep 17 00:00:00 2001 From: Michel Anderson Lutz Teixeira Date: Mon, 8 Jan 2024 17:37:27 -0300 Subject: [PATCH] config to deploy on fly --- app/main.py | 5 +---- fly.toml | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 fly.toml diff --git a/app/main.py b/app/main.py index cb7e8f8..a9ae8fa 100644 --- a/app/main.py +++ b/app/main.py @@ -1,5 +1,4 @@ import logging -import os from dotenv import load_dotenv from fastapi import FastAPI @@ -21,8 +20,7 @@ app = FastAPI() -print(os.getenv("PROJECT_NAME")) - +# print(os.getenv("PROJECT_NAME")) # title=config("PROJECT_NAME") # CORS @@ -34,7 +32,6 @@ allow_headers=["*"], ) - def init_db(): try: Base.metadata.create_all(bind=engine) diff --git a/fly.toml b/fly.toml new file mode 100644 index 0000000..7f4fcc0 --- /dev/null +++ b/fly.toml @@ -0,0 +1,22 @@ +# fly.toml app configuration file generated for dev-challenge on 2024-01-08T16:24:31-03:00 +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = "dev-challenge" +primary_region = "gru" + +[build] + +[http_service] + internal_port = 8000 + force_https = true + auto_stop_machines = true + auto_start_machines = true + min_machines_running = 0 + processes = ["app"] + +[[vm]] + cpu_kind = "shared" + cpus = 1 + memory_mb = 1024