setup pydantic_settings; import .gitignore

This commit is contained in:
2026-04-16 20:21:14 +08:00
parent 4bb768aa33
commit 9d8467214a
5 changed files with 44 additions and 6 deletions
+25
View File
@@ -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
+14
View File
@@ -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()
View File
+5
View File
@@ -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
-6
View File
@@ -1,6 +0,0 @@
def main():
print("Hello from endorphin!")
if __name__ == "__main__":
main()