lab4 done
This commit is contained in:
+45
-2
@@ -43,6 +43,25 @@ services:
|
||||
resources:
|
||||
limits: {cpus: '0.5', memory: 128M}
|
||||
update_config: {parallelism: 1, order: stop-first}
|
||||
minio:
|
||||
image: ${S3_IMAGE:-mtusi-minio:RELEASE.2025-09-07T16-13-09Z}
|
||||
secrets: [s3_root_access_key, s3_root_secret_key]
|
||||
volumes: [s3_data:/data]
|
||||
networks: [data]
|
||||
healthcheck:
|
||||
test: [CMD, wget, -q, -T, '2', -O, /dev/null, 'http://127.0.0.1:9000/minio/health/live']
|
||||
interval: 2s
|
||||
timeout: 3s
|
||||
start_period: 15s
|
||||
retries: 15
|
||||
stop_grace_period: 20s
|
||||
deploy:
|
||||
replicas: 1
|
||||
placement:
|
||||
constraints: [node.labels.mtusi_lab4_storage == true]
|
||||
resources:
|
||||
limits: {cpus: '1.0', memory: 512M}
|
||||
update_config: {parallelism: 1, order: stop-first}
|
||||
api:
|
||||
image: ${API_IMAGE:-mtusi-messenger:lab4}
|
||||
environment:
|
||||
@@ -56,7 +75,14 @@ services:
|
||||
REDIS_ADDR: redis:6379
|
||||
SESSION_TTL_SECONDS: '3600'
|
||||
QUERY_TIMEOUT_MS: '1000'
|
||||
secrets: [postgres_password, cursor_key]
|
||||
S3_ENDPOINT: minio:9000
|
||||
S3_BUCKET: attachments
|
||||
S3_ACCESS_KEY_FILE: /run/secrets/s3_access_key
|
||||
S3_SECRET_KEY_FILE: /run/secrets/s3_secret_key
|
||||
S3_USE_SSL: 'false'
|
||||
GOMEMLIMIT: 1152MiB
|
||||
GOGC: '50'
|
||||
secrets: [postgres_password, cursor_key, s3_access_key, s3_secret_key]
|
||||
networks: [backend, data]
|
||||
stop_grace_period: 15s
|
||||
healthcheck:
|
||||
@@ -69,7 +95,7 @@ services:
|
||||
replicas: ${API_REPLICAS:-2}
|
||||
endpoint_mode: dnsrr
|
||||
resources:
|
||||
limits: {cpus: '1.0', memory: 256M}
|
||||
limits: {cpus: '1.0', memory: 1536M}
|
||||
restart_policy: {condition: any, delay: 1s}
|
||||
update_config:
|
||||
parallelism: 1
|
||||
@@ -107,11 +133,16 @@ networks:
|
||||
volumes:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
s3_data:
|
||||
configs:
|
||||
haproxy:
|
||||
file: ./infra/haproxy.cfg
|
||||
redis:
|
||||
file: ./infra/redis.conf
|
||||
s3_bootstrap:
|
||||
file: ./infra/s3-bootstrap.sh
|
||||
s3_policy:
|
||||
file: ./infra/s3-policy.json
|
||||
secrets:
|
||||
postgres_password:
|
||||
external: true
|
||||
@@ -119,3 +150,15 @@ secrets:
|
||||
cursor_key:
|
||||
external: true
|
||||
name: ${STACK_NAME:-mtusi-lab4}_cursor_key
|
||||
s3_root_access_key:
|
||||
external: true
|
||||
name: ${STACK_NAME:-mtusi-lab4}_s3_root_access_key
|
||||
s3_root_secret_key:
|
||||
external: true
|
||||
name: ${STACK_NAME:-mtusi-lab4}_s3_root_secret_key
|
||||
s3_access_key:
|
||||
external: true
|
||||
name: ${STACK_NAME:-mtusi-lab4}_s3_access_key
|
||||
s3_secret_key:
|
||||
external: true
|
||||
name: ${STACK_NAME:-mtusi-lab4}_s3_secret_key
|
||||
|
||||
Reference in New Issue
Block a user