File tree Expand file tree Collapse file tree 4 files changed +26
-8
lines changed
Expand file tree Collapse file tree 4 files changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ ENTRYPOINT []
3232
3333RUN python setup.py
3434
35+ EXPOSE 8080
3536# Run the FastAPI application by default
3637# Uses `fastapi dev` to enable hot-reloading when the `watch` sync occurs
3738# Uses `--host 0.0.0.0` to allow access from outside the container
Original file line number Diff line number Diff line change 1+ ---
2+ title : Python Project Template
3+ emoji : 🟧
4+ colorFrom : yellow
5+ colorTo : purple
6+ sdk : docker
7+ tags :
8+ - Python
9+ fullwidth : true
10+ license : mit
11+ app_port : 8080
12+ ---
13+
114# Python Project Template
215
316A modern Python project template with best practices for development, testing, and deployment.
Original file line number Diff line number Diff line change 55
66from .routes import v1_router
77
8+
89def create_app () -> FastAPI :
910 """Create and configure the FastAPI application."""
10- app = FastAPI (
11-
12- )
11+ app = FastAPI ()
1312
1413 # Add CORS middleware
1514 app .add_middleware (
@@ -35,5 +34,6 @@ async def shutdown_event():
3534
3635 return app
3736
37+
3838# Create default app instance
39- app = create_app ()
39+ app = create_app ()
Original file line number Diff line number Diff line change 1- import uvicorn
1+ import uvicorn
22from .app import app as api_app
3+ import logging
4+
35
46def main ():
57 """Main application entry point."""
@@ -8,10 +10,12 @@ def main():
810 uvicorn .run (
911 api_app ,
1012 host = "0.0.0.0" ,
11- port = 8800 ,
13+ port = 8080 ,
1214 reload = False ,
1315 )
1416 except Exception as e :
15- print (f"Application failed to start: { e } " , exc_info = True )
17+ logging . error (f"Application failed to start: { e } " , exc_info = True )
1618 raise
17- main ()
19+
20+
21+ main ()
You can’t perform that action at this time.
0 commit comments