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 []
32
32
33
33
RUN python setup.py
34
34
35
+ EXPOSE 8080
35
36
# Run the FastAPI application by default
36
37
# Uses `fastapi dev` to enable hot-reloading when the `watch` sync occurs
37
38
# 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
+
1
14
# Python Project Template
2
15
3
16
A modern Python project template with best practices for development, testing, and deployment.
Original file line number Diff line number Diff line change 5
5
6
6
from .routes import v1_router
7
7
8
+
8
9
def create_app () -> FastAPI :
9
10
"""Create and configure the FastAPI application."""
10
- app = FastAPI (
11
-
12
- )
11
+ app = FastAPI ()
13
12
14
13
# Add CORS middleware
15
14
app .add_middleware (
@@ -35,5 +34,6 @@ async def shutdown_event():
35
34
36
35
return app
37
36
37
+
38
38
# 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
2
2
from .app import app as api_app
3
+ import logging
4
+
3
5
4
6
def main ():
5
7
"""Main application entry point."""
@@ -8,10 +10,12 @@ def main():
8
10
uvicorn .run (
9
11
api_app ,
10
12
host = "0.0.0.0" ,
11
- port = 8800 ,
13
+ port = 8080 ,
12
14
reload = False ,
13
15
)
14
16
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 )
16
18
raise
17
- main ()
19
+
20
+
21
+ main ()
You can’t perform that action at this time.
0 commit comments