为容器增加限制

This commit is contained in:
leo
2023-12-31 18:15:28 +08:00
parent 6b7bef0861
commit 44ef312811
2 changed files with 12 additions and 1 deletions

View File

@@ -3,5 +3,15 @@ version: "3"
services: services:
build_self: build_self:
build: . build: .
container_name: build_self
ports: ports:
- "5001:80" - "5001:80"
storage_opt:
size: 50M
cpus: 0.5
deploy:
resources:
limits:
memory: 100M
reservations:
memory: 100M

View File

@@ -28,6 +28,7 @@ def open_selected_file():
def save_file_content(): def save_file_content():
with open(st.session_state.page_file['filepath'], 'w', encoding='utf-8') as f: with open(st.session_state.page_file['filepath'], 'w', encoding='utf-8') as f:
logger.debug(f"save: <\n{st.session_state.file_content}\n>to file {st.session_state.page_file['filepath']}")
f.write(st.session_state.file_content) f.write(st.session_state.file_content)