Реализовать ЛР 7 на оценку 4
Skeleton contracts / contracts (pull_request) Blocked by required conditions
Skeleton contracts / contracts (pull_request) Blocked by required conditions
This commit is contained in:
+41
-3
@@ -10,10 +10,20 @@ x-runtime-environment: &runtime-environment
|
||||
|
||||
x-telemetry-proxy: &telemetry-proxy
|
||||
image: haproxy:3.2.26-alpine
|
||||
read_only: true
|
||||
tmpfs: ["/tmp:rw,nosuid,nodev,noexec,size=8m,mode=1777"]
|
||||
security_opt: [no-new-privileges:true]
|
||||
cap_drop: [ALL]
|
||||
cpus: "0.25"
|
||||
mem_limit: 96m
|
||||
restart: unless-stopped
|
||||
|
||||
x-restricted-runtime: &restricted-runtime
|
||||
read_only: true
|
||||
tmpfs: ["/tmp:rw,nosuid,nodev,noexec,size=16m,mode=1777"]
|
||||
security_opt: [no-new-privileges:true]
|
||||
cap_drop: [ALL]
|
||||
|
||||
x-otel-environment: &otel-environment
|
||||
OTEL_SDK_DISABLED: ${OTEL_SDK_DISABLED:-false}
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: https://otel-collector:4318
|
||||
@@ -31,6 +41,7 @@ x-otel-environment: &otel-environment
|
||||
services:
|
||||
openbao:
|
||||
image: openbao/openbao:2.5.0
|
||||
security_opt: [no-new-privileges:true]
|
||||
cpus: "0.5"
|
||||
mem_limit: 256m
|
||||
command: ["server", "-config=/openbao/config/bao.hcl"]
|
||||
@@ -54,6 +65,7 @@ services:
|
||||
|
||||
postgres:
|
||||
image: postgres:17.4-alpine
|
||||
security_opt: [no-new-privileges:true]
|
||||
cpus: "1.0"
|
||||
mem_limit: 512m
|
||||
environment:
|
||||
@@ -81,7 +93,8 @@ services:
|
||||
retries: 20
|
||||
|
||||
redis:
|
||||
image: redis:7.4.2-alpine
|
||||
image: redis:7.4.12-alpine
|
||||
security_opt: [no-new-privileges:true]
|
||||
cpus: "0.25"
|
||||
mem_limit: 128m
|
||||
command: ["redis-server", "/run/secrets/redis_config"]
|
||||
@@ -102,6 +115,7 @@ services:
|
||||
|
||||
broker:
|
||||
image: rabbitmq:4.1.4-alpine
|
||||
security_opt: [no-new-privileges:true]
|
||||
hostname: ${BROKER_HOSTNAME:-broker}
|
||||
extra_hosts:
|
||||
- "${BROKER_HOSTNAME:-broker}:127.0.0.1"
|
||||
@@ -113,7 +127,7 @@ services:
|
||||
- lab_ca
|
||||
- broker_definitions
|
||||
- source: broker_config
|
||||
target: /etc/rabbitmq/conf.d/30-lab.conf
|
||||
target: /etc/rabbitmq/conf.d/30-lab-mtls.conf
|
||||
volumes:
|
||||
- broker_data:/var/lib/rabbitmq
|
||||
- ./infra/rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins:ro
|
||||
@@ -125,6 +139,7 @@ services:
|
||||
retries: 20
|
||||
|
||||
s3:
|
||||
<<: *restricted-runtime
|
||||
image: cgr.dev/chainguard/minio@sha256:3c60a2a8c4d33409a9bc7a623a7fcbfb4605adc3d89422d2f53b3f673a6e5597
|
||||
user: "0"
|
||||
cpus: "0.5"
|
||||
@@ -134,6 +149,7 @@ services:
|
||||
MINIO_ROOT_USER_FILE: /run/secrets/s3_root_user
|
||||
MINIO_ROOT_PASSWORD_FILE: /run/secrets/s3_root_password
|
||||
MC_HOST_local: https://s3:9000
|
||||
MC_CONFIG_DIR: /tmp/mc
|
||||
SSL_CERT_FILE: /run/secrets/lab_ca
|
||||
secrets: [s3_root_user, s3_root_password, lab_ca]
|
||||
volumes:
|
||||
@@ -146,6 +162,7 @@ services:
|
||||
retries: 20
|
||||
|
||||
s3-bootstrap:
|
||||
<<: *restricted-runtime
|
||||
image: cgr.dev/chainguard/minio-client@sha256:39768db4c3fa811bc8f2e2a3e0add8ea391648b1c980de179985e1c353dc1805
|
||||
cpus: "0.25"
|
||||
mem_limit: 128m
|
||||
@@ -167,6 +184,7 @@ services:
|
||||
mc admin policy attach local "messenger-$$role" --user "messenger-$$role"
|
||||
done
|
||||
environment:
|
||||
MC_CONFIG_DIR: /tmp/mc
|
||||
S3_BUCKET: ${S3_BUCKET:-messenger-attachments}
|
||||
SSL_CERT_FILE: /run/secrets/lab_ca
|
||||
secrets: [s3_root_user, s3_root_password, s3_api_secret, s3_worker_secret, lab_ca]
|
||||
@@ -180,6 +198,10 @@ services:
|
||||
|
||||
migrate:
|
||||
build: .
|
||||
read_only: true
|
||||
security_opt: [no-new-privileges:true]
|
||||
cap_drop: [ALL]
|
||||
tmpfs: ["/tmp:rw,nosuid,nodev,noexec,size=16m,mode=1777"]
|
||||
cpus: "0.5"
|
||||
mem_limit: 256m
|
||||
command: ["alembic", "upgrade", "head"]
|
||||
@@ -194,7 +216,9 @@ services:
|
||||
restart: "no"
|
||||
|
||||
db-permissions:
|
||||
<<: *restricted-runtime
|
||||
image: postgres:17.4-alpine
|
||||
user: postgres
|
||||
cpus: "0.25"
|
||||
mem_limit: 96m
|
||||
entrypoint: ["/bin/sh", "-ec"]
|
||||
@@ -217,6 +241,8 @@ services:
|
||||
|
||||
api:
|
||||
build: .
|
||||
read_only: true
|
||||
tmpfs: ["/tmp:rw,nosuid,nodev,noexec,size=64m,mode=1777"]
|
||||
security_opt: [no-new-privileges:true]
|
||||
cap_drop: [ALL]
|
||||
cpus: "0.5"
|
||||
@@ -226,6 +252,7 @@ services:
|
||||
OTEL_SERVICE_NAME: messenger-api
|
||||
BAO_ROLE: api
|
||||
LOG_LEVEL: ${LOG_LEVEL:-info}
|
||||
LOGIN_CONCURRENCY: ${LOGIN_CONCURRENCY:-2}
|
||||
LOGIN_LIMIT: ${LOGIN_LIMIT:-20}
|
||||
LOGIN_WINDOW_SECONDS: ${LOGIN_WINDOW_SECONDS:-60}
|
||||
REQUEST_MAX_BYTES: ${REQUEST_MAX_BYTES:-65536}
|
||||
@@ -263,6 +290,8 @@ services:
|
||||
|
||||
publisher:
|
||||
build: .
|
||||
read_only: true
|
||||
tmpfs: ["/tmp:rw,nosuid,nodev,noexec,size=16m,mode=1777"]
|
||||
init: true
|
||||
stop_signal: SIGINT
|
||||
security_opt: [no-new-privileges:true]
|
||||
@@ -296,6 +325,8 @@ services:
|
||||
|
||||
worker:
|
||||
build: .
|
||||
read_only: true
|
||||
tmpfs: ["/tmp:rw,nosuid,nodev,noexec,size=32m,mode=1777"]
|
||||
init: true
|
||||
stop_signal: SIGINT
|
||||
security_opt: [no-new-privileges:true]
|
||||
@@ -341,7 +372,7 @@ services:
|
||||
stop_grace_period: 70s
|
||||
|
||||
lb:
|
||||
image: haproxy:3.2.26-alpine
|
||||
<<: *telemetry-proxy
|
||||
cpus: "0.25"
|
||||
mem_limit: 128m
|
||||
ports:
|
||||
@@ -372,6 +403,7 @@ services:
|
||||
aliases: [otel-collector]
|
||||
|
||||
otel-collector:
|
||||
<<: *restricted-runtime
|
||||
network_mode: "service:collector-tls"
|
||||
image: otel/opentelemetry-collector-contrib:0.123.0
|
||||
cpus: "0.5"
|
||||
@@ -401,6 +433,7 @@ services:
|
||||
aliases: [prometheus]
|
||||
|
||||
prometheus:
|
||||
<<: *restricted-runtime
|
||||
network_mode: "service:prometheus-tls"
|
||||
image: prom/prometheus:v3.2.1
|
||||
cpus: "0.5"
|
||||
@@ -434,9 +467,11 @@ services:
|
||||
aliases: [loki]
|
||||
|
||||
loki:
|
||||
<<: *restricted-runtime
|
||||
network_mode: "service:loki-tls"
|
||||
image: grafana/loki:3.4.2
|
||||
user: "0"
|
||||
cap_add: [DAC_OVERRIDE]
|
||||
cpus: "0.5"
|
||||
mem_limit: 384m
|
||||
command: ["-config.file=/etc/loki/loki.yaml"]
|
||||
@@ -458,9 +493,11 @@ services:
|
||||
aliases: [tempo]
|
||||
|
||||
tempo:
|
||||
<<: *restricted-runtime
|
||||
network_mode: "service:tempo-tls"
|
||||
image: grafana/tempo:2.7.2
|
||||
user: "0"
|
||||
cap_add: [DAC_OVERRIDE]
|
||||
cpus: "0.5"
|
||||
mem_limit: 384m
|
||||
command: ["-config.file=/etc/tempo/tempo.yaml"]
|
||||
@@ -470,6 +507,7 @@ services:
|
||||
restart: unless-stopped
|
||||
|
||||
grafana:
|
||||
<<: *restricted-runtime
|
||||
image: grafana/grafana:11.6.0
|
||||
cpus: "0.5"
|
||||
mem_limit: 384m
|
||||
|
||||
Reference in New Issue
Block a user