From 9d8467214a27fcd9d3cb928bf2fc6439d1e249c2 Mon Sep 17 00:00:00 2001 From: Zayden Jung Date: Thu, 16 Apr 2026 20:21:14 +0800 Subject: [PATCH] setup pydantic_settings; import .gitignore --- .gitignore | 25 +++++++++++++++++++++++++ app/config.py | 14 ++++++++++++++ app/main.py | 0 docker-compose.yml | 5 +++++ main.py | 6 ------ 5 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 .gitignore create mode 100644 app/config.py create mode 100644 app/main.py delete mode 100644 main.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b808ce0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +*.json +*.jsonl + +*.zip + +__pycache__/ +*.pyc +.env* +.venv/ + +*outputs* + +*.png + +.trunk/ + +*out +*logs +*actions +*notifications +*tools +plugins +user_trunk.yaml +user.yaml +tmp \ No newline at end of file diff --git a/app/config.py b/app/config.py new file mode 100644 index 0000000..c77c69c --- /dev/null +++ b/app/config.py @@ -0,0 +1,14 @@ +from pydantic_settings import BaseSettings, SettingsConfigDict + +class Settings(BaseSettings): + database_url: str + + s3_endpoint: str + s3_access_key: str + s3_secret_key: str + s3_region: str = "us-east-1" + s3_bucket_name: str + + model_config = SettingsConfigDict(env_file=".env", extra="ignore") + +settings = Settings() \ No newline at end of file diff --git a/app/main.py b/app/main.py new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml index 1e81a7c..aeaebaa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,6 +14,11 @@ services: build: . environment: DATABASE_URL: postgres://$SERVICE_USER_POSTGRES:$SERVICE_PASSWORD_POSTGRES@postgres:5432/endorphin_db + S3_ENDPOINT: ${S3_ENDPOINT} + S3_ACCESS_KEY: ${S3_ACCESS_KEY} + S3_SECRET_KEY: ${S3_SECRET_KEY} + S3_REGION: ${S3_REGION:-us-east-1} + S3_BUCKET_NAME: ${S3_BUCKET_NAME} healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/health"] interval: 10s diff --git a/main.py b/main.py deleted file mode 100644 index 9ad6cc8..0000000 --- a/main.py +++ /dev/null @@ -1,6 +0,0 @@ -def main(): - print("Hello from endorphin!") - - -if __name__ == "__main__": - main()