forked from mtusi2026/mtusi2026lab6
615 lines
18 KiB
YAML
615 lines
18 KiB
YAML
services:
|
|
load-balancer:
|
|
build:
|
|
context: .
|
|
dockerfile: infrastructure/haproxy/Dockerfile
|
|
image: mtusi2026lab6-load-balancer
|
|
ports:
|
|
- "127.0.0.1:${PUBLIC_PORT:-8080}:8080"
|
|
depends_on:
|
|
api:
|
|
condition: service_healthy
|
|
frontend:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
"wget -qO- http://127.0.0.1:8080/health/ready || exit 1",
|
|
]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 10
|
|
start_period: 3s
|
|
stop_grace_period: 10s
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.25"
|
|
memory: 128M
|
|
|
|
frontend:
|
|
build:
|
|
context: .
|
|
dockerfile: infrastructure/nginx/Dockerfile
|
|
image: mtusi2026lab6-web
|
|
expose:
|
|
- "8080"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8080/ >/dev/null || exit 1"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 10
|
|
start_period: 3s
|
|
stop_grace_period: 10s
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.10"
|
|
memory: 64M
|
|
|
|
postgres:
|
|
image: postgres:16.15-alpine3.24@sha256:721873c34ceb9f8d8fc265984940dc982404c105f19ad51be9fdc5970a6080ea
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-messenger}
|
|
POSTGRES_DB: ${POSTGRES_DB:-messenger}
|
|
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
|
secrets:
|
|
- postgres_password
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
"pg_isready -U ${POSTGRES_USER:-messenger} -d ${POSTGRES_DB:-messenger}",
|
|
]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 10
|
|
start_period: 5s
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "${POSTGRES_CPU_LIMIT:-1.00}"
|
|
memory: ${POSTGRES_MEMORY_LIMIT:-512M}
|
|
|
|
redis:
|
|
image: redis:8.10.2-alpine3.23@sha256:3811787313eba226a2ef38658c6ccb91cd5e110edc89c37767de373120a0e5a0
|
|
command:
|
|
[
|
|
"redis-server",
|
|
"--save",
|
|
"",
|
|
"--appendonly",
|
|
"no",
|
|
"--maxmemory",
|
|
"64mb",
|
|
"--maxmemory-policy",
|
|
"allkeys-lru",
|
|
]
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 10
|
|
start_period: 3s
|
|
stop_grace_period: 10s
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.25"
|
|
memory: 128M
|
|
|
|
migrate:
|
|
image: migrate/migrate:v4.20.1@sha256:76cc2074cb6642631f34a898ced71e6aeaa6b1a4d78c4daa743275a22e0c5be7
|
|
entrypoint: ["/bin/sh", "-ec"]
|
|
command:
|
|
- >
|
|
exec migrate
|
|
-path=/migrations
|
|
-database="$$(cat /run/secrets/database_url)"
|
|
up
|
|
secrets:
|
|
- database_url
|
|
volumes:
|
|
- ./migrations:/migrations:ro
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: "no"
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.25"
|
|
memory: 64M
|
|
|
|
minio:
|
|
build:
|
|
context: .
|
|
dockerfile: infrastructure/minio/Dockerfile
|
|
target: server
|
|
args:
|
|
MINIO_VERSION: RELEASE.2025-10-15T17-29-55Z
|
|
image: mtusi2026lab6-minio:RELEASE.2025-10-15T17-29-55Z
|
|
command: ["server", "/data", "--address", ":9000"]
|
|
environment:
|
|
MINIO_ROOT_USER_FILE: /run/secrets/minio_root_user
|
|
MINIO_ROOT_PASSWORD_FILE: /run/secrets/minio_root_password
|
|
MINIO_BROWSER: "off"
|
|
secrets:
|
|
- minio_root_user
|
|
- minio_root_password
|
|
volumes:
|
|
- minio_data:/data
|
|
expose:
|
|
- "9000"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:9000/minio/health/live >/dev/null || exit 1"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 20
|
|
start_period: 10s
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.75"
|
|
memory: 512M
|
|
|
|
minio-bootstrap:
|
|
build:
|
|
context: .
|
|
dockerfile: infrastructure/minio/Dockerfile
|
|
target: client
|
|
args:
|
|
MC_VERSION: RELEASE.2025-08-13T08-35-41Z
|
|
image: mtusi2026lab6-mc:RELEASE.2025-08-13T08-35-41Z
|
|
entrypoint: ["/bin/sh", "-ec"]
|
|
command:
|
|
- |
|
|
root_user="$$(cat /run/secrets/minio_root_user)"
|
|
root_password="$$(cat /run/secrets/minio_root_password)"
|
|
api_user="$$(cat /run/secrets/s3_access_key_id)"
|
|
api_password="$$(cat /run/secrets/s3_secret_access_key)"
|
|
mc alias set local http://minio:9000 "$$root_user" "$$root_password" --api S3v4
|
|
mc mb --ignore-existing "local/$${S3_BUCKET}"
|
|
mc anonymous set none "local/$${S3_BUCKET}"
|
|
sed "s/__BUCKET__/$${S3_BUCKET}/g" /config/api-policy.template.json > /tmp/api-policy.json
|
|
mc admin policy create local messenger-api /tmp/api-policy.json
|
|
if ! mc admin user info local "$$api_user" >/dev/null 2>&1; then
|
|
mc admin user add local "$$api_user" "$$api_password"
|
|
fi
|
|
mc admin policy attach local messenger-api --user "$$api_user"
|
|
environment:
|
|
S3_BUCKET: ${S3_BUCKET:-messenger-attachments}
|
|
secrets:
|
|
- minio_root_user
|
|
- minio_root_password
|
|
- s3_access_key_id
|
|
- s3_secret_access_key
|
|
volumes:
|
|
- ./infrastructure/minio/api-policy.template.json:/config/api-policy.template.json:ro
|
|
depends_on:
|
|
minio:
|
|
condition: service_healthy
|
|
restart: "no"
|
|
|
|
broker:
|
|
image: rabbitmq:4.1.4-alpine
|
|
entrypoint: ["/bin/sh", "-ec"]
|
|
command:
|
|
- |
|
|
export RABBITMQ_DEFAULT_USER=messenger
|
|
export RABBITMQ_DEFAULT_PASS="$$(cat /run/secrets/broker_password)"
|
|
exec docker-entrypoint.sh rabbitmq-server
|
|
secrets:
|
|
- broker_password
|
|
volumes:
|
|
- broker_data:/var/lib/rabbitmq
|
|
healthcheck:
|
|
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
start_period: 10s
|
|
stop_grace_period: 20s
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.50"
|
|
memory: 256M
|
|
|
|
dispatcher:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: mtusi2026lab6-app
|
|
entrypoint: ["/app/dispatcher"]
|
|
environment:
|
|
DATABASE_URL_FILE: /run/secrets/database_url
|
|
BROKER_URL_FILE: /run/secrets/broker_url
|
|
DB_CONNECT_TIMEOUT: ${DB_CONNECT_TIMEOUT:-5s}
|
|
DB_QUERY_TIMEOUT: ${DB_QUERY_TIMEOUT:-3s}
|
|
JOB_TIMEOUT_SECONDS: ${JOB_TIMEOUT_SECONDS:-60}
|
|
JOB_RETRY_BASE: ${JOB_RETRY_BASE:-250ms}
|
|
JOB_RETRY_MAX: ${JOB_RETRY_MAX:-4s}
|
|
JOB_LEASE_SECONDS: ${JOB_LEASE_SECONDS:-75}
|
|
DISPATCHER_FAULT_BEFORE_PUBLISH_FILE: /tmp/mtusi-fault-before-publish
|
|
OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT:-http://otel-collector:4318}
|
|
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
|
|
OTEL_EXPORTER_OTLP_TIMEOUT: ${OTEL_EXPORTER_OTLP_TIMEOUT:-3000}
|
|
OTEL_TRACES_SAMPLER: parentbased_always_on
|
|
secrets:
|
|
- database_url
|
|
- broker_url
|
|
depends_on:
|
|
broker:
|
|
condition: service_healthy
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
disable: true
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.25"
|
|
memory: 128M
|
|
|
|
worker:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: mtusi2026lab6-app
|
|
entrypoint: ["/app/worker"]
|
|
environment:
|
|
DATABASE_URL_FILE: /run/secrets/database_url
|
|
BROKER_URL_FILE: /run/secrets/broker_url
|
|
S3_ENDPOINT: ${S3_ENDPOINT:-http://minio: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
|
|
S3_OPERATION_TIMEOUT: ${S3_OPERATION_TIMEOUT:-5s}
|
|
WORKER_CONCURRENCY: ${WORKER_CONCURRENCY:-2}
|
|
JOB_MAX_ATTEMPTS: ${JOB_MAX_ATTEMPTS:-5}
|
|
JOB_TIMEOUT_SECONDS: ${JOB_TIMEOUT_SECONDS:-60}
|
|
JOB_RETRY_BASE: ${JOB_RETRY_BASE:-250ms}
|
|
JOB_RETRY_MAX: ${JOB_RETRY_MAX:-4s}
|
|
JOB_LEASE_SECONDS: ${JOB_LEASE_SECONDS:-75}
|
|
STAGING_RETENTION_SECONDS: ${STAGING_RETENTION_SECONDS:-86400}
|
|
STAGING_CLEANUP_INTERVAL_SECONDS: ${STAGING_CLEANUP_INTERVAL_SECONDS:-30}
|
|
WORKER_FAULT_BEFORE_OBJECTS_FILE: /tmp/mtusi-fault-before-objects
|
|
WORKER_FAULT_AFTER_OBJECTS_FILE: /tmp/mtusi-fault-after-objects
|
|
DB_CONNECT_TIMEOUT: ${DB_CONNECT_TIMEOUT:-5s}
|
|
DB_QUERY_TIMEOUT: ${DB_QUERY_TIMEOUT:-3s}
|
|
GOMEMLIMIT: ${WORKER_GO_MEMORY_LIMIT:-448MiB}
|
|
OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT:-http://otel-collector:4318}
|
|
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
|
|
OTEL_EXPORTER_OTLP_TIMEOUT: ${OTEL_EXPORTER_OTLP_TIMEOUT:-3000}
|
|
OTEL_TRACES_SAMPLER: parentbased_always_on
|
|
secrets:
|
|
- database_url
|
|
- broker_url
|
|
- s3_access_key_id
|
|
- s3_secret_access_key
|
|
depends_on:
|
|
broker:
|
|
condition: service_healthy
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
minio-bootstrap:
|
|
condition: service_completed_successfully
|
|
stop_grace_period: 70s
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
disable: true
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "1.00"
|
|
memory: ${WORKER_MEMORY_LIMIT:-512M}
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: mtusi2026lab6-app
|
|
environment:
|
|
APP_HOST: ${APP_HOST:-0.0.0.0}
|
|
APP_PORT: ${APP_INTERNAL_PORT:-8080}
|
|
APP_ENV: ${APP_ENV:-lab}
|
|
|
|
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
|
IDEMPOTENCY_TTL_SECONDS: ${IDEMPOTENCY_TTL_SECONDS:-86400}
|
|
JOB_MAX_ATTEMPTS: ${JOB_MAX_ATTEMPTS:-5}
|
|
SESSION_STORE: ${SESSION_STORE:-postgres}
|
|
SESSION_COOKIE_SECURE: ${SESSION_COOKIE_SECURE:-false}
|
|
CURSOR_SIGNING_KEY_FILE: ${CURSOR_SIGNING_KEY_FILE:-/run/secrets/cursor_signing_key}
|
|
|
|
CACHE_URL: ${CACHE_URL:-redis://redis:6379/0}
|
|
CACHE_TTL: ${CACHE_TTL:-5m}
|
|
CACHE_OPERATION_TIMEOUT: ${CACHE_OPERATION_TIMEOUT:-250ms}
|
|
CACHE_POOL_SIZE: ${CACHE_POOL_SIZE:-10}
|
|
|
|
S3_ENDPOINT: ${S3_ENDPOINT:-http://minio:9000}
|
|
S3_REGION: ${S3_REGION:-us-east-1}
|
|
S3_BUCKET: ${S3_BUCKET:-messenger-attachments}
|
|
S3_ACCESS_KEY_ID_FILE: ${S3_ACCESS_KEY_ID_FILE:-/run/secrets/s3_access_key_id}
|
|
S3_SECRET_ACCESS_KEY_FILE: ${S3_SECRET_ACCESS_KEY_FILE:-/run/secrets/s3_secret_access_key}
|
|
S3_OPERATION_TIMEOUT: ${S3_OPERATION_TIMEOUT:-5s}
|
|
|
|
DATABASE_URL_FILE: ${DATABASE_URL_FILE:-/run/secrets/database_url}
|
|
|
|
DB_MAX_CONNS: ${DB_MAX_CONNS:-10}
|
|
DB_MIN_CONNS: ${DB_MIN_CONNS:-2}
|
|
DB_MAX_CONN_LIFETIME: ${DB_MAX_CONN_LIFETIME:-30m}
|
|
DB_MAX_CONN_IDLE_TIME: ${DB_MAX_CONN_IDLE_TIME:-5m}
|
|
DB_HEALTH_CHECK_PERIOD: ${DB_HEALTH_CHECK_PERIOD:-30s}
|
|
DB_CONNECT_TIMEOUT: ${DB_CONNECT_TIMEOUT:-5s}
|
|
DB_QUERY_TIMEOUT: ${DB_QUERY_TIMEOUT:-3s}
|
|
|
|
READINESS_TIMEOUT: ${READINESS_TIMEOUT:-2s}
|
|
SHUTDOWN_DRAIN_DELAY: ${SHUTDOWN_DRAIN_DELAY:-2s}
|
|
SHUTDOWN_TIMEOUT: ${SHUTDOWN_TIMEOUT:-10s}
|
|
GOMEMLIMIT: ${API_GO_MEMORY_LIMIT:-220MiB}
|
|
OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT:-http://otel-collector:4318}
|
|
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
|
|
OTEL_EXPORTER_OTLP_TIMEOUT: ${OTEL_EXPORTER_OTLP_TIMEOUT:-3000}
|
|
OTEL_TRACES_SAMPLER: parentbased_always_on
|
|
secrets:
|
|
- database_url
|
|
- s3_access_key_id
|
|
- s3_secret_access_key
|
|
- cursor_signing_key
|
|
expose:
|
|
- "8080"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
minio-bootstrap:
|
|
condition: service_completed_successfully
|
|
deploy:
|
|
replicas: ${API_REPLICAS:-2}
|
|
resources:
|
|
limits:
|
|
cpus: "${API_CPU_LIMIT:-0.50}"
|
|
memory: ${API_MEMORY_LIMIT:-256M}
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
"wget -qO- http://127.0.0.1:$${APP_PORT:-8080}/health/ready || exit 1",
|
|
]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 10
|
|
start_period: 5s
|
|
stop_grace_period: 15s
|
|
restart: unless-stopped
|
|
|
|
loki:
|
|
image: grafana/loki:3.7.9
|
|
command: ["-config.file=/etc/loki/config.yaml"]
|
|
ports:
|
|
- "127.0.0.1:${LOKI_PORT:-3100}:3100"
|
|
volumes:
|
|
- ./infrastructure/telemetry/loki/config.yaml:/etc/loki/config.yaml:ro
|
|
- loki_data:/loki
|
|
expose:
|
|
- "3100"
|
|
healthcheck:
|
|
test: ["CMD", "/usr/bin/loki", "-version"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.50"
|
|
memory: 384M
|
|
|
|
tempo:
|
|
image: grafana/tempo:2.10.5
|
|
command: ["-config.file=/etc/tempo/config.yaml"]
|
|
ports:
|
|
- "127.0.0.1:${TEMPO_PORT:-3200}:3200"
|
|
volumes:
|
|
- ./infrastructure/telemetry/tempo/config.yaml:/etc/tempo/config.yaml:ro
|
|
- tempo_data:/var/tempo
|
|
expose:
|
|
- "3200"
|
|
- "4318"
|
|
healthcheck:
|
|
test: ["CMD", "/tempo", "-version"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.50"
|
|
memory: 384M
|
|
|
|
otel-collector:
|
|
image: otel/opentelemetry-collector-contrib:0.165.0
|
|
command: ["--config=/etc/otelcol-contrib/config.yaml"]
|
|
volumes:
|
|
- ./infrastructure/telemetry/otel-collector/config.yaml:/etc/otelcol-contrib/config.yaml:ro
|
|
expose:
|
|
- "4318"
|
|
- "8888"
|
|
- "8889"
|
|
- "13133"
|
|
depends_on:
|
|
loki:
|
|
condition: service_healthy
|
|
tempo:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "/otelcol-contrib", "components"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.50"
|
|
memory: 256M
|
|
|
|
prometheus:
|
|
image: prom/prometheus:v3.16.0
|
|
command:
|
|
- --config.file=/etc/prometheus/prometheus.yaml
|
|
- --storage.tsdb.path=/prometheus
|
|
- --storage.tsdb.retention.time=7d
|
|
ports:
|
|
- "127.0.0.1:${PROMETHEUS_PORT:-9090}:9090"
|
|
volumes:
|
|
- ./infrastructure/telemetry/prometheus/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro
|
|
- ./infrastructure/telemetry/prometheus/rules:/etc/prometheus/rules:ro
|
|
- prometheus_data:/prometheus
|
|
expose:
|
|
- "9090"
|
|
depends_on:
|
|
otel-collector:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "/bin/prometheus", "--version"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.50"
|
|
memory: 384M
|
|
|
|
grafana:
|
|
image: grafana/grafana:13.3.0
|
|
ports:
|
|
- "127.0.0.1:${GRAFANA_PORT:-3000}:3000"
|
|
environment:
|
|
GF_AUTH_ANONYMOUS_ENABLED: "true"
|
|
GF_AUTH_ANONYMOUS_ORG_ROLE: Viewer
|
|
GF_AUTH_DISABLE_LOGIN_FORM: "true"
|
|
GF_USERS_DEFAULT_THEME: dark
|
|
GF_ANALYTICS_CHECK_FOR_UPDATES: "false"
|
|
GF_ANALYTICS_REPORTING_ENABLED: "false"
|
|
GF_PLUGINS_PREINSTALL_DISABLED: "true"
|
|
GF_PLUGINS_PREINSTALL_AUTO_UPDATE: "false"
|
|
GF_PLUGINS_PLUGIN_ADMIN_ENABLED: "false"
|
|
GF_SECURITY_X_XSS_PROTECTION: "false"
|
|
volumes:
|
|
- grafana_data:/var/lib/grafana
|
|
- ./infrastructure/telemetry/grafana/provisioning:/etc/grafana/provisioning:ro
|
|
- ./infrastructure/telemetry/grafana/dashboards:/var/lib/grafana/dashboards:ro
|
|
depends_on:
|
|
prometheus:
|
|
condition: service_healthy
|
|
loki:
|
|
condition: service_healthy
|
|
tempo:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:3000/api/health >/dev/null || exit 1"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 20
|
|
start_period: 10s
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.50"
|
|
memory: 384M
|
|
|
|
redis-insight:
|
|
image: redis/redisinsight:3.8.0@sha256:b5e19ee240abef6edb435871b90ff8a210995422e8e018ab61c0339d318a1f84
|
|
profiles: ["tools"]
|
|
ports:
|
|
- "127.0.0.1:${REDIS_INSIGHT_PORT:-5540}:5540"
|
|
volumes:
|
|
- redis_insight_data:/data
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.50"
|
|
memory: 256M
|
|
|
|
postgres-restore:
|
|
image: postgres:16.15-alpine3.24@sha256:721873c34ceb9f8d8fc265984940dc982404c105f19ad51be9fdc5970a6080ea
|
|
profiles: ["recovery"]
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-messenger}
|
|
POSTGRES_DB: ${POSTGRES_RESTORE_DB:-messenger_restore_admin}
|
|
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
|
secrets:
|
|
- postgres_password
|
|
volumes:
|
|
- postgres_restore_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
"pg_isready -U ${POSTGRES_USER:-messenger} -d ${POSTGRES_RESTORE_DB:-messenger_restore_admin}",
|
|
]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 10
|
|
start_period: 5s
|
|
restart: "no"
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "1.00"
|
|
memory: 512M
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_insight_data:
|
|
minio_data:
|
|
broker_data:
|
|
postgres_restore_data:
|
|
prometheus_data:
|
|
loki_data:
|
|
tempo_data:
|
|
grafana_data:
|
|
|
|
secrets:
|
|
postgres_password:
|
|
file: ./secrets/postgres_password.txt
|
|
database_url:
|
|
file: ./secrets/database_url.txt
|
|
cursor_signing_key:
|
|
file: ./secrets/cursor_signing_key.txt
|
|
minio_root_user:
|
|
file: ./secrets/minio_root_user.txt
|
|
minio_root_password:
|
|
file: ./secrets/minio_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
|
|
broker_password:
|
|
file: ./secrets/broker_password.txt
|
|
broker_url:
|
|
file: ./secrets/broker_url.txt
|