version: '3.11' services: python-logger: build: context: . dockerfile: Dockerfile # 启用 BuildKit 缓存 args: - BUILDKIT_INLINE_CACHE=1 # 允许缓存复用 container_name: my-python-logger volumes: - ./logs:/app/logs working_dir: /app #restart: unless-stopped restart: on-failure