136 lines
3.9 KiB
YAML
136 lines
3.9 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
environment:
|
|
POSTGRES_DB: memevault
|
|
POSTGRES_USER: memevault
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?err}
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U memevault"]
|
|
interval: 5s
|
|
retries: 5
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
retries: 5
|
|
|
|
minio:
|
|
image: pgsty/silo:latest
|
|
command: server /data --console-address ":9001"
|
|
ports:
|
|
- "9000:9000"
|
|
- "9001:9001"
|
|
environment:
|
|
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-memevault}
|
|
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:?err}
|
|
# Rewrite presigned URLs to this public base URL so browsers can reach them.
|
|
MINIO_SERVER_URL: ${MINIO_PUBLIC_URL:-http://localhost:9000}
|
|
volumes:
|
|
- minio-data:/data
|
|
healthcheck:
|
|
test: ["CMD", "mc", "ready", "local"]
|
|
interval: 5s
|
|
retries: 10
|
|
|
|
minio-init:
|
|
image: pgsty/silo:latest
|
|
depends_on:
|
|
minio:
|
|
condition: service_healthy
|
|
environment:
|
|
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY:-memevault}
|
|
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY:?err}
|
|
entrypoint: >
|
|
/bin/sh -c "
|
|
mc alias set local http://minio:9000 $$MINIO_ACCESS_KEY $$MINIO_SECRET_KEY &&
|
|
mc mb --ignore-existing local/memevault &&
|
|
echo 'Bucket ready.'
|
|
"
|
|
restart: "no"
|
|
|
|
migrator:
|
|
build: .
|
|
command: ["dotnet", "/app/migrator/MemeVault.Migrator.dll"]
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
ConnectionStrings__Postgres: Host=postgres;Database=memevault;Username=memevault;Password=${POSTGRES_PASSWORD}
|
|
restart: "no"
|
|
|
|
api:
|
|
build: .
|
|
ports:
|
|
- "8080:8080"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
minio:
|
|
condition: service_healthy
|
|
minio-init:
|
|
condition: service_completed_successfully
|
|
migrator:
|
|
condition: service_completed_successfully
|
|
environment:
|
|
ASPNETCORE_URLS: http://+:8080
|
|
ConnectionStrings__Postgres: Host=postgres;Database=memevault;Username=memevault;Password=${POSTGRES_PASSWORD}
|
|
ConnectionStrings__Redis: redis:6379
|
|
Telegram__BotToken: ${TELEGRAM_BOT_TOKEN:?err}
|
|
Telegram__ApiBaseUrl: ${TELEGRAM_API_BASE_URL:-https://api.telegram.org}
|
|
Jwt__SecretKey: ${JWT_SECRET_KEY:?err}
|
|
Jwt__ExpiryHours: 24
|
|
S3__ServiceUrl: ${MINIO_PUBLIC_URL:-http://localhost:9000}
|
|
S3__AccessKey: ${MINIO_ACCESS_KEY:-memevault}
|
|
S3__SecretKey: ${MINIO_SECRET_KEY:?err}
|
|
S3__BucketName: memevault
|
|
|
|
bot:
|
|
build: .
|
|
command: ["dotnet", "/app/bot/MemeVault.Bot.dll"]
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
migrator:
|
|
condition: service_completed_successfully
|
|
environment:
|
|
ASPNETCORE_URLS: http://+:8081
|
|
ConnectionStrings__Postgres: Host=postgres;Database=memevault;Username=memevault;Password=${POSTGRES_PASSWORD}
|
|
ConnectionStrings__Redis: redis:6379
|
|
Telegram__BotToken: ${TELEGRAM_BOT_TOKEN:?err}
|
|
Telegram__ApiBaseUrl: ${TELEGRAM_API_BASE_URL:-https://api.telegram.org}
|
|
Bot__Token: ${TELEGRAM_BOT_TOKEN:?err}
|
|
Bot__Mode: ${TELEGRAM_MODE:-Polling}
|
|
# Bot__WebhookHost: https://your-domain.com # только для Webhook-режима
|
|
|
|
prometheus:
|
|
image: prom/prometheus:v3.3.1
|
|
ports:
|
|
- "9090:9090"
|
|
volumes:
|
|
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
|
- prometheus-data:/prometheus
|
|
command:
|
|
- "--config.file=/etc/prometheus/prometheus.yml"
|
|
- "--storage.tsdb.retention.time=7d"
|
|
|
|
miniapp:
|
|
build: ./miniapp
|
|
ports:
|
|
- "3000:80"
|
|
depends_on:
|
|
- api
|
|
|
|
volumes:
|
|
postgres-data:
|
|
minio-data:
|
|
prometheus-data:
|