Files
mtusi2026lab6/compose.yaml

1 line
7.7 KiB
YAML

{name: mtuci-vp6-medvedev,x-api: {image: mtuci-vp6:local,build: ".",cpus: 1,mem_limit: 2g,stop_grace_period: 10s,read_only: true,security_opt: &security_opt [no-new-privileges:true],cap_drop: &cap_drop [ALL],tmpfs: &tmpfs ["/tmp:uid=65532,gid=65532,size=256m,mode=1777"],environment: {APP_PORT: 8080,SESSION_TTL_SECONDS: 3600,PG_MAX_CONNS: 8,GOMEMLIMIT: 1536MiB},secrets: &secrets [database_url,cache_url,s3_credentials],depends_on: &depends_on {migrate: {condition: service_completed_successfully},valkey: {condition: service_started},bootstrap: {condition: service_completed_successfully}},networks: &networks [private]},services: {postgres: {image: postgres:18.6@sha256:74935e72241653ca55e0414067e6d8763aceb8a810eb51b452253ec3dcfc4336,cpus: 1,mem_limit: 768m,environment: {POSTGRES_USER: messenger,POSTGRES_DB: messenger,POSTGRES_PASSWORD_FILE: /run/secrets/pg_password},secrets: [pg_password],volumes: [postgres:/var/lib/postgresql],healthcheck: {test: [CMD-SHELL,pg_isready -h 127.0.0.1 -U messenger -d messenger],interval: 2s,timeout: 2s,retries: 30},networks: [private]},valkey: {image: valkey/valkey:9@sha256:418652cfb58ef879d4978c33553735d7147016032d5aefaa14c828e611eb9dfd,cpus: 0.25,mem_limit: 128m,command: [valkey-server,/run/secrets/valkey_conf],secrets: [valkey_conf],volumes: [valkey:/data],networks: [private]},s3: {image: rustfs/rustfs:1.0.0-rc.1@sha256:f53d700fc16809070326f6ab3fb565d48e722364a7bd5a12e47d0a5abe079ce6,cpus: 1,mem_limit: 768m,environment: {RUSTFS_ACCESS_KEY_FILE: /run/secrets/s3_access,RUSTFS_SECRET_KEY_FILE: /run/secrets/s3_secret,RUSTFS_VOLUMES: /data,RUSTFS_CONSOLE_ENABLE: "false"},secrets: [s3_access,s3_secret],volumes: [s3:/data],healthcheck: {test: [CMD,curl,"-f",http://127.0.0.1:9000/health],interval: 2s,timeout: 2s,retries: 40},networks: [private]},migrate: {image: mtuci-vp6:local,command: ["-migrate"],cpus: 0.5,mem_limit: 256m,secrets: [database_url],depends_on: {postgres: {condition: service_healthy}},networks: [private]},bootstrap: {image: mtuci-vp6:local,command: ["-bootstrap-s3"],cpus: 0.5,mem_limit: 256m,secrets: [database_url,s3_root,s3_credentials],depends_on: {s3: {condition: service_healthy}},networks: [private]},api: {networks: *networks,depends_on: *depends_on,secrets: *secrets,environment: {APP_PORT: 8080,SESSION_TTL_SECONDS: 3600,PG_MAX_CONNS: 8,GOMEMLIMIT: 1536MiB,OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318,OTEL_TRACES_SAMPLER_ARG: "1"},tmpfs: *tmpfs,cap_drop: *cap_drop,security_opt: *security_opt,read_only: true,stop_grace_period: 10s,mem_limit: 2g,cpus: 1,build: ".",image: mtuci-vp6:local,deploy: {replicas: 2}},worker: {networks: *networks,depends_on: *depends_on,secrets: *secrets,environment: {GOMEMLIMIT: 384MiB,WORKER_MAX_ATTEMPTS: 5,OTEL_EXPORTER_OTLP_ENDPOINT: http://otel-collector:4318,OTEL_TRACES_SAMPLER_ARG: "1"},tmpfs: ["/tmp:uid=65532,gid=65532,size=256m,mode=1777"],cap_drop: *cap_drop,security_opt: *security_opt,read_only: true,stop_grace_period: 10s,mem_limit: 2g,cpus: 1,image: mtuci-vp6:local,entrypoint: [/worker]},lb: {image: haproxy:3.2-alpine@sha256:1c3568e520453cc8ba98c39501febcf450429c80e6cc27ecad779961d76e597c,cpus: 0.25,mem_limit: 128m,ports: [127.0.0.1:28206:8080],volumes: [./config/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro],depends_on: {api: {condition: service_started}},networks: [private,edge]},init-telemetry: {image: debian@sha256:a29215f6a35e51e22adffa17f89e9d2ef06214e64a2bad10d765c46aea49f11f,entrypoint: [/bin/sh,"-c"],command: [chown 10001:10001 /openobserve && chown 472:472 /grafana],volumes: [openobserve:/openobserve,grafana:/grafana],cpus: 0.25,mem_limit: 128m,networks: [private]},otel-collector: {image: docker.io/library/mtuci-vp6-collector-cache:0.163.2,pull_policy: never,command: ["--config=/etc/otelcol.yaml"],volumes: [./config/otel-collector.yaml:/etc/otelcol.yaml:ro],secrets: [openobserve_ingest_auth],cpus: 0.5,mem_limit: 256m,read_only: true,cap_drop: [ALL],security_opt: [no-new-privileges:true],stop_grace_period: 10s,ports: [127.0.0.1:28706:4318,127.0.0.1:28806:8888],networks: [private,telemetry-data,edge],depends_on: {openobserve: {condition: service_started}}},grafana: {image: docker.io/library/mtuci-vp6-grafana-cache:13.3.1,environment: {GF_AUTH_ANONYMOUS_ENABLED: "true",GF_AUTH_ANONYMOUS_ORG_ROLE: Viewer,GF_AUTH_DISABLE_LOGIN_FORM: "false",GF_USERS_ALLOW_SIGN_UP: "false",GF_SECURITY_ADMIN_PASSWORD__FILE: /run/secrets/grafana_password,GF_ANALYTICS_REPORTING_ENABLED: "false",GF_DATAPROXY_RESPONSE_LIMIT: "1048576",GF_DATAPROXY_TIMEOUT: "10",GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: openobserve,GF_ANALYTICS_CHECK_FOR_UPDATES: "false",GF_SMTP_ENABLED: "false",GF_ANALYTICS_CHECK_FOR_PLUGIN_UPDATES: "false",GF_PLUGINS_PREINSTALL_DISABLED: "true",GF_PLUGINS_PREINSTALL_AUTO_UPDATE: "false"},secrets: [grafana_password],volumes: [./config/grafana/provisioning:/etc/grafana/provisioning:ro,./config/grafana/dashboards:/var/lib/grafana/dashboards:ro,grafana:/var/lib/grafana,{type: bind,source: ./.local/grafana-plugins,target: /var/lib/grafana/plugins,read_only: true,bind: {create_host_path: false}}],ports: [127.0.0.1:28306:3000],cpus: 0.5,mem_limit: 384m,networks: [grafana-query],depends_on: {openobserve: {condition: service_started},init-telemetry: {condition: service_completed_successfully},observe-query: {condition: service_started}},profiles: [grafana-pending],pull_policy: never,env_file: [{path: .local/grafana-openobserve.env,required: false}]},openobserve: {image: docker.io/library/mtuci-vp6-openobserve-cache:v1.1.2,pull_policy: never,user: 10001:10001,cpus: 1,mem_limit: 2g,read_only: true,cap_drop: [ALL],security_opt: [no-new-privileges:true],tmpfs: ["/tmp:uid=10001,gid=10001,size=128m,mode=1777"],stop_grace_period: 15s,env_file: [.local/openobserve-v2.env],environment: {ZO_LOCAL_MODE: "true",ZO_LOCAL_MODE_STORAGE: disk,ZO_DATA_DIR: /data/,ZO_HTTP_PORT: "5080",ZO_TELEMETRY: "false",ZO_WEB_URL: http://127.0.0.1:28406,ZO_MEMORY_CACHE_MAX_SIZE: "128",ZO_MEMORY_CACHE_ENABLED: "false",ZO_DISK_CACHE_ENABLED: "false",ZO_COMPACT_ENABLED: "true",ZO_MAX_FILE_SIZE_ON_DISK: "16",ZO_QUERY_TIMEOUT: "5",ZO_MAX_QUERY_RANGE_FOR_SA: "1",ZO_QUERY_DEFAULT_LIMIT: "1000",ZO_QUERY_THREAD_NUM: "2",ZO_HTTP_WORKER_NUM: "2",ZO_MEMORY_CACHE_DATAFUSION_MAX_SIZE: "256",ZO_MEM_TABLE_MAX_SIZE: "128",ZO_METRICS_MAX_POINTS_PER_SERIES: "3600",ZO_METRICS_MAX_SERIES_RESPONSE: "1000"},volumes: [openobserve:/data],ports: [127.0.0.1:28406:5080],networks: [telemetry-data,edge],depends_on: {init-telemetry: {condition: service_completed_successfully}}},observe-query: {image: haproxy:3.2-alpine@sha256:1c3568e520453cc8ba98c39501febcf450429c80e6cc27ecad779961d76e597c,pull_policy: never,command: [haproxy,"-W","-db","-f",/etc/query.cfg,"-f",/run/secrets/openobserve_query_users],user: 10001:10001,volumes: [./config/openobserve-query.cfg:/etc/query.cfg:ro],secrets: [openobserve_query_users],ports: [127.0.0.1:28906:5082],cpus: 0.25,mem_limit: 64m,read_only: true,cap_drop: [ALL],security_opt: [no-new-privileges:true],stop_grace_period: 5s,networks: {telemetry-data: {},grafana-query: {aliases: [observe-query]},edge: {}},depends_on: {openobserve: {condition: service_started}}}},networks: {private: {internal: true},edge: {},telemetry-data: {internal: true},grafana-query: {name: mtuci-vp6-medvedev_grafana-query-v2}},volumes: {postgres: {},valkey: {},s3: {},grafana: {},openobserve: {}},secrets: {pg_password: {file: .local/pg_password},database_url: {file: .local/database_url},cache_url: {file: .local/cache_url},valkey_conf: {file: .local/valkey.conf},s3_access: {file: .local/s3_access},s3_secret: {file: .local/s3_secret},s3_root: {file: .local/s3_root},s3_credentials: {file: .local/s3_credentials},grafana_password: {file: .local/grafana_password},openobserve_ingest_auth: {file: .local/openobserve_sa_ingest_auth},openobserve_query_users: {file: .local/openobserve_query_users.cfg}}}