Выполнение lab4 на 4
This commit is contained in:
+60
-2
@@ -6,11 +6,22 @@ services:
|
||||
scale: 2
|
||||
environment:
|
||||
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
||||
GOMEMLIMIT: 1024MiB
|
||||
DATABASE_PASSWORD_FILE: /run/secrets/postgres_password
|
||||
REDIS_ADDR: redis:6379
|
||||
secrets: [postgres_password]
|
||||
S3_ENDPOINT: http://s3:9000
|
||||
S3_REGION: ${S3_REGION:-us-east-1}
|
||||
S3_BUCKET: ${S3_BUCKET:-messenger-attachments}
|
||||
S3_ACCESS_KEY_ID_FILE: /run/secrets/s3_access_key_id
|
||||
S3_SECRET_ACCESS_KEY_FILE: /run/secrets/s3_secret_access_key
|
||||
secrets: [postgres_password, s3_access_key_id, s3_secret_access_key]
|
||||
# Bounded ephemeral staging; one upload at a time per API.
|
||||
tmpfs:
|
||||
- /tmp:size=16m,mode=1777
|
||||
cpus: 1.0
|
||||
mem_limit: 384m
|
||||
# 16-bit PNG decoding includes the image and scanline buffers, not just bytes.
|
||||
mem_limit: 1536m
|
||||
memswap_limit: 1536m
|
||||
stop_grace_period: 15s
|
||||
depends_on:
|
||||
postgres:
|
||||
@@ -19,6 +30,44 @@ services:
|
||||
condition: service_completed_successfully
|
||||
redis:
|
||||
condition: service_started
|
||||
s3-bootstrap:
|
||||
condition: service_completed_successfully
|
||||
|
||||
s3:
|
||||
build:
|
||||
context: ./infra/s3
|
||||
target: server
|
||||
command: [server, /data, --console-address, "127.0.0.1:9001"]
|
||||
environment:
|
||||
MINIO_ROOT_USER_FILE: /run/secrets/s3_root_user
|
||||
MINIO_ROOT_PASSWORD_FILE: /run/secrets/s3_root_password
|
||||
MINIO_BROWSER: "off"
|
||||
MINIO_REGION_NAME: ${S3_REGION:-us-east-1}
|
||||
secrets: [s3_root_user, s3_root_password]
|
||||
volumes:
|
||||
- s3_lab4_data_v1:/data
|
||||
cpus: 1.0
|
||||
mem_limit: 512m
|
||||
stop_grace_period: 30s
|
||||
# No published ports: S3 is reachable only inside the Compose network.
|
||||
|
||||
s3-bootstrap:
|
||||
build:
|
||||
context: ./infra/s3
|
||||
target: client
|
||||
entrypoint: [/bin/sh, /bootstrap/bootstrap.sh]
|
||||
environment:
|
||||
S3_BUCKET: ${S3_BUCKET:-messenger-attachments}
|
||||
MC_CONFIG_DIR: /tmp/mc
|
||||
secrets: [s3_root_user, s3_root_password, s3_access_key_id, s3_secret_access_key]
|
||||
volumes:
|
||||
- ./infra/s3:/bootstrap:ro
|
||||
tmpfs: [/tmp]
|
||||
cpus: 0.25
|
||||
mem_limit: 128m
|
||||
depends_on:
|
||||
s3:
|
||||
condition: service_started
|
||||
|
||||
lb:
|
||||
image: haproxy:3.2.4-alpine
|
||||
@@ -86,6 +135,15 @@ services:
|
||||
secrets:
|
||||
postgres_password:
|
||||
file: ./secrets/postgres_password.txt
|
||||
s3_root_user:
|
||||
file: ./secrets/s3_root_user.txt
|
||||
s3_root_password:
|
||||
file: ./secrets/s3_root_password.txt
|
||||
s3_access_key_id:
|
||||
file: ./secrets/s3_access_key_id.txt
|
||||
s3_secret_access_key:
|
||||
file: ./secrets/s3_secret_access_key.txt
|
||||
|
||||
volumes:
|
||||
postgres_lab4_data_v1:
|
||||
s3_lab4_data_v1:
|
||||
|
||||
Reference in New Issue
Block a user