325 lines
9.7 KiB
YAML
325 lines
9.7 KiB
YAML
services:
|
|
proto-gen:
|
|
build:
|
|
context: ../proto
|
|
dockerfile: ../deploy/Dockerfile.proto-gen
|
|
image: yoresee_doc_proto_gen:latest
|
|
container_name: yoresee_doc_proto_gen
|
|
volumes:
|
|
- ../proto:/workspace/proto
|
|
- ../backend/pkg/gen:/workspace/backend/pkg/gen
|
|
- ../collab-go/pkg/gen:/workspace/collab-go/pkg/gen
|
|
- ../frontend/src/gen:/workspace/frontend/src/gen
|
|
- ../collab/src/gen:/workspace/collab/src/gen
|
|
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: yoresee_doc_nginx
|
|
ports:
|
|
- "${NGINX_HTTP_PORT:-8080}:80"
|
|
- "${NGINX_HTTPS_PORT:-8443}:443"
|
|
volumes:
|
|
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
|
|
- ./nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf
|
|
- ./logs/nginx:/var/log/nginx
|
|
depends_on:
|
|
- frontend
|
|
- backend
|
|
- collab
|
|
- minio
|
|
networks:
|
|
- yoresee_doc_network
|
|
restart: unless-stopped
|
|
|
|
frontend:
|
|
build:
|
|
context: ../frontend
|
|
dockerfile: Dockerfile
|
|
target: dev
|
|
image: yoresee_doc_frontend_dev:latest
|
|
container_name: yoresee_doc_frontend
|
|
volumes:
|
|
- ../frontend:/app
|
|
- /app/node_modules
|
|
environment:
|
|
- NODE_ENV=development
|
|
- VITE_API_BASE_URL=${VITE_API_BASE_URL:-http://localhost:8080}
|
|
- VITE_GRPC_WEB_ENDPOINT=${VITE_GRPC_WEB_ENDPOINT:-/grpc}
|
|
networks:
|
|
- yoresee_doc_network
|
|
restart: unless-stopped
|
|
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
container_name: yoresee_doc_postgres
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-root}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-your_password}
|
|
POSTGRES_DB: ${POSTGRES_DB:-yoresee_doc_db}
|
|
ports:
|
|
- "${POSTGRES_HOST_PORT:-5432}:${POSTGRES_PORT:-5432}"
|
|
volumes:
|
|
- yoresee_doc_postgres_data:/var/lib/postgresql/data
|
|
networks:
|
|
- yoresee_doc_network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-root} -d ${POSTGRES_DB:-yoresee_doc_db}"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: yoresee_doc_redis
|
|
environment:
|
|
REDIS_PASSWORD: ${REDIS_PASSWORD:-your_redis_password}
|
|
ports:
|
|
- "${REDIS_HOST_PORT:-6379}:${REDIS_PORT:-6379}"
|
|
volumes:
|
|
- yoresee_doc_redis_data:/data
|
|
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
|
|
command: redis-server /usr/local/etc/redis/redis.conf
|
|
networks:
|
|
- yoresee_doc_network
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
consul:
|
|
image: hashicorp/consul:1.16
|
|
container_name: yoresee_doc_consul
|
|
command: "agent -dev -client=0.0.0.0 -ui"
|
|
environment:
|
|
CONSUL_LOCAL_CONFIG: >-
|
|
{"acl":{"enabled":true,"default_policy":"deny","down_policy":"extend-cache","enable_token_persistence":true,"tokens":{"initial_management":"${CONSUL_ROOT_TOKEN:-yoresee_doc_root_token}"}}}
|
|
ports:
|
|
- "${CONSUL_HOST_PORT:-8500}:${CONSUL_PORT:-8500}"
|
|
volumes:
|
|
- yoresee_doc_consul_data:/consul/data
|
|
networks:
|
|
- yoresee_doc_network
|
|
restart: unless-stopped
|
|
|
|
rabbitmq:
|
|
image: rabbitmq:3-management
|
|
container_name: yoresee_doc_rabbitmq
|
|
environment:
|
|
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER:-guest}
|
|
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS:-guest}
|
|
ports:
|
|
- "${RABBITMQ_AMQP_HOST_PORT:-5672}:${RABBITMQ_AMQP_PORT:-5672}"
|
|
volumes:
|
|
- yoresee_doc_rabbitmq_data:/var/lib/rabbitmq
|
|
- ./rabbitmq/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro
|
|
- ./logs/rabbitmq:/var/log/rabbitmq
|
|
networks:
|
|
- yoresee_doc_network
|
|
healthcheck:
|
|
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
minio:
|
|
image: minio/minio:latest
|
|
container_name: yoresee_doc_minio
|
|
command: server /data --console-address ":${MINIO_CONSOLE_PORT:-9001}"
|
|
environment:
|
|
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin}
|
|
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minioadmin}
|
|
MINIO_BROWSER_REDIRECT_URL: ${MINIO_BROWSER_REDIRECT_URL:-http://localhost:8080/minio}
|
|
volumes:
|
|
- yoresee_doc_minio_data:/data
|
|
networks:
|
|
- yoresee_doc_network
|
|
restart: unless-stopped
|
|
|
|
elasticsearch:
|
|
image: docker.elastic.co/elasticsearch/elasticsearch:8.15.3
|
|
container_name: yoresee_doc_elasticsearch
|
|
environment:
|
|
- discovery.type=single-node
|
|
- xpack.security.enabled=false
|
|
- xpack.security.enrollment.enabled=false
|
|
- ES_JAVA_OPTS=-Xms512m -Xmx512m
|
|
ports:
|
|
- "${ELASTICSEARCH_HOST_PORT:-9200}:${ELASTICSEARCH_PORT:-9200}"
|
|
volumes:
|
|
- yoresee_doc_elasticsearch_data:/usr/share/elasticsearch/data
|
|
networks:
|
|
- yoresee_doc_network
|
|
restart: unless-stopped
|
|
|
|
backend:
|
|
build:
|
|
context: ../backend
|
|
dockerfile: Dockerfile
|
|
target: dev
|
|
image: yoresee_doc_backend_dev:latest
|
|
container_name: yoresee_doc_backend
|
|
volumes:
|
|
- ../backend:/app
|
|
ports:
|
|
- "${BACKEND_DEBUG_HOST_PORT:-2345}:2345"
|
|
- "${BACKEND_GRPC_HOST_PORT:-9090}:${BACKEND_GRPC_PORT:-9090}"
|
|
environment:
|
|
- BACKEND_INTERNAL_RPC_KEY=${BACKEND_INTERNAL_RPC_KEY:-yoresee_doc_internal_key}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
rabbitmq:
|
|
condition: service_healthy
|
|
minio:
|
|
condition: service_started
|
|
elasticsearch:
|
|
condition: service_started
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--spider", "-q", "http://${BACKEND_HOST:-backend}:${BACKEND_GRPC_PORT:-9090}/health"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 20
|
|
start_period: 30s
|
|
networks:
|
|
- yoresee_doc_network
|
|
restart: unless-stopped
|
|
|
|
collab-core:
|
|
build:
|
|
context: ..
|
|
dockerfile: collab/Dockerfile
|
|
image: yoresee_doc_collab_core:latest
|
|
container_name: yoresee_doc_collab_core
|
|
environment:
|
|
- REDIS_HOST=${REDIS_HOST:-redis}
|
|
- REDIS_PORT=${REDIS_PORT:-6379}
|
|
- REDIS_PASSWORD=${REDIS_PASSWORD:-your_redis_password}
|
|
- REDIS_DB=${REDIS_DB:-0}
|
|
- BACKEND_ADDR=${BACKEND_HOST:-backend}:${BACKEND_GRPC_PORT:-9090}
|
|
- DIRTY_DOC_MQ=${DIRTY_DOC_MQ:-rabbitmq}
|
|
- DIRTY_DOC_TOPIC=${DIRTY_DOC_TOPIC:-collab.dirty_docs}
|
|
- RABBITMQ_URL=amqp://${RABBITMQ_DEFAULT_USER:-guest}:${RABBITMQ_DEFAULT_PASS:-guest}@${RABBITMQ_HOST:-rabbitmq}:${RABBITMQ_AMQP_PORT:-5672}/
|
|
- INTERNAL_RPC_KEY=${BACKEND_INTERNAL_RPC_KEY:-yoresee_doc_internal_key}
|
|
- DIRTY_DOC_NOTIFY_THRESHOLD=${DIRTY_DOC_NOTIFY_THRESHOLD:-5}
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
backend:
|
|
condition: service_healthy
|
|
rabbitmq:
|
|
condition: service_healthy
|
|
networks:
|
|
- yoresee_doc_network
|
|
volumes:
|
|
- ../collab:/app
|
|
restart: unless-stopped
|
|
|
|
collab:
|
|
build:
|
|
context: ../collab-go
|
|
dockerfile: Dockerfile
|
|
image: yoresee_doc_collab_gateway:latest
|
|
container_name: yoresee_doc_collab
|
|
environment:
|
|
- ADDR=:${COLLAB_GATEWAY_PORT:-1234}
|
|
- JWT_SECRET=${JWT_SECRET:-yoresee_doc_jwt_secret_key}
|
|
- COLLAB_CORE_URL=ws://${COLLAB_CORE_HOST:-collab-core}:${COLLAB_CORE_PORT:-1234}
|
|
- BACKEND_GRPC_ADDR=${BACKEND_HOST:-backend}:${BACKEND_GRPC_PORT:-9090}
|
|
- INTERNAL_RPC_KEY=${BACKEND_INTERNAL_RPC_KEY:-yoresee_doc_internal_key}
|
|
volumes:
|
|
- ../collab-go:/app
|
|
depends_on:
|
|
- collab-core
|
|
networks:
|
|
- yoresee_doc_network
|
|
restart: unless-stopped
|
|
|
|
snapshot-worker:
|
|
build:
|
|
context: ../backend
|
|
dockerfile: Dockerfile
|
|
target: dev
|
|
image: yoresee_doc_snapshot_worker_dev:latest
|
|
container_name: yoresee_doc_snapshot_worker
|
|
volumes:
|
|
- ../backend:/app
|
|
environment:
|
|
- COLLAB_CORE_HTTP=http://${COLLAB_CORE_HOST:-collab-core}:${COLLAB_CORE_PORT:-1234}
|
|
command: sh -c "go mod download && go run ./cmd/snapshot-worker"
|
|
depends_on:
|
|
rabbitmq:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
elasticsearch:
|
|
condition: service_started
|
|
networks:
|
|
- yoresee_doc_network
|
|
restart: unless-stopped
|
|
|
|
notification-worker:
|
|
build:
|
|
context: ../backend
|
|
dockerfile: Dockerfile
|
|
target: dev
|
|
image: yoresee_doc_notification_worker_dev:latest
|
|
container_name: yoresee_doc_notification_worker
|
|
volumes:
|
|
- ../backend:/app
|
|
environment:
|
|
- NOTIFICATION_MQ=${NOTIFICATION_MQ:-rabbitmq}
|
|
command: sh -c "go mod download && go run ./cmd/notification-worker"
|
|
depends_on:
|
|
rabbitmq:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
postgres:
|
|
condition: service_healthy
|
|
networks:
|
|
- yoresee_doc_network
|
|
restart: unless-stopped
|
|
|
|
search-sync-worker:
|
|
build:
|
|
context: ../backend
|
|
dockerfile: Dockerfile
|
|
target: dev
|
|
image: yoresee_doc_search_sync_worker_dev:latest
|
|
container_name: yoresee_doc_search_sync_worker
|
|
volumes:
|
|
- ../backend:/app
|
|
environment:
|
|
- SEARCH_SYNC_MQ=${SEARCH_SYNC_MQ:-rabbitmq}
|
|
command: sh -c "go mod download && go run ./cmd/search-sync-worker"
|
|
depends_on:
|
|
rabbitmq:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
postgres:
|
|
condition: service_healthy
|
|
elasticsearch:
|
|
condition: service_started
|
|
networks:
|
|
- yoresee_doc_network
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
yoresee_doc_postgres_data:
|
|
yoresee_doc_redis_data:
|
|
yoresee_doc_consul_data:
|
|
yoresee_doc_rabbitmq_data:
|
|
yoresee_doc_minio_data:
|
|
yoresee_doc_elasticsearch_data:
|
|
|
|
networks:
|
|
yoresee_doc_network:
|
|
driver: bridge
|