Завершить уровень 4: проверить ошибки, ограничить память и автоматизировать сверку S3

This commit is contained in:
2026-10-30 17:47:29 +03:00
parent 4f85fb96a6
commit 9dded977a5
25 changed files with 1213 additions and 90 deletions
+19 -2
View File
@@ -49,7 +49,10 @@ services:
healthcheck:
disable: true
s3:
image: minio/minio@sha256:14cea493d9a34af32f524e538b8346cf79f3321eff8e708c1e2960462bd8936e
image: lyakhonov-storage:lab4
build:
context: .
dockerfile: Dockerfile.s3
command: [server, /data, --console-address, '127.0.0.1:9001']
environment:
MINIO_ROOT_USER_FILE: /run/secrets/s3_root_user
@@ -59,7 +62,8 @@ services:
cpus: 1
mem_limit: 768m
bucket-init:
image: minio/minio@sha256:14cea493d9a34af32f524e538b8346cf79f3321eff8e708c1e2960462bd8936e
image: lyakhonov-storage:lab4
pull_policy: never
entrypoint: [/bin/sh, /bootstrap/bucket.sh]
secrets: [s3_root_user, s3_root_password, s3_access_key, s3_secret_key]
volumes: [./infra/bucket.sh:/bootstrap/bucket.sh:ro, ./infra/s3-policy.json:/bootstrap/policy.json:ro]
@@ -73,6 +77,19 @@ services:
condition: service_completed_successfully
deploy:
replicas: ${API_REPLICAS:-2}
reconciler:
<<: *api
command: [python, -m, src.reconcile, --apply, --interval, '300']
restart: unless-stopped
cpus: 0.25
mem_limit: 256m
healthcheck:
disable: true
depends_on:
migrate:
condition: service_completed_successfully
bucket-init:
condition: service_completed_successfully
lb:
image: haproxy:3.0.6-alpine
ports: ["127.0.0.1:${LAB4_PORT:-8084}:8080"]