sanbo
commited on
Commit
·
b97bace
1
Parent(s):
35eb9fc
update sth. at 2025-01-05 00:25:16
Browse files- Dockerfile +2 -3
- more_core.py +1 -1
Dockerfile
CHANGED
@@ -16,7 +16,6 @@ RUN apt-get update \
|
|
16 |
&& apt-get clean
|
17 |
|
18 |
COPY requirements.txt .
|
19 |
-
|
20 |
# 升级 pip 并全局安装依赖
|
21 |
RUN pip install --upgrade pip
|
22 |
RUN pip install --no-cache-dir -r requirements.txt
|
@@ -40,8 +39,8 @@ COPY --from=builder /usr/local /usr/local
|
|
40 |
COPY more_core.py .
|
41 |
RUN chmod +x more_core.py
|
42 |
|
43 |
-
|
44 |
-
|
45 |
|
46 |
EXPOSE ${PORT}
|
47 |
|
|
|
16 |
&& apt-get clean
|
17 |
|
18 |
COPY requirements.txt .
|
|
|
19 |
# 升级 pip 并全局安装依赖
|
20 |
RUN pip install --upgrade pip
|
21 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
39 |
COPY more_core.py .
|
40 |
RUN chmod +x more_core.py
|
41 |
|
42 |
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
43 |
+
CMD curl -f http://localhost:${PORT}/ || exit 1
|
44 |
|
45 |
EXPOSE ${PORT}
|
46 |
|
more_core.py
CHANGED
@@ -199,7 +199,7 @@ class APIServer:
|
|
199 |
"""Check if routes need to be reloaded based on environment variables"""
|
200 |
# reload Debug
|
201 |
global debug
|
202 |
-
debug = os.getenv("DEBUG", debug)
|
203 |
# relaod routes
|
204 |
new_routes = self._get_routes()
|
205 |
current_routes = [route for route in self.app.routes if hasattr(route, 'path')]
|
|
|
199 |
"""Check if routes need to be reloaded based on environment variables"""
|
200 |
# reload Debug
|
201 |
global debug
|
202 |
+
debug = os.getenv("DEBUG", debug).lower() in ["true", "1", "t"]
|
203 |
# relaod routes
|
204 |
new_routes = self._get_routes()
|
205 |
current_routes = [route for route in self.app.routes if hasattr(route, 'path')]
|