muyu-apiserver/deploy/docker-compose.yaml
Chever John a25acdc5e4 chore: sync codebase with upstream
Pull latest changes from upstream/main (GitHub) including:
- Purchase RPC service (proto, server, logic, models)
- Gateway route updates for purchase endpoints
- SQL migration and config updates

Excludes deploy/bin/ pre-compiled arm64 binaries (builds use
multi-stage Dockerfiles targeting amd64).
2026-06-15 09:20:56 +08:00

158 lines
3.7 KiB
YAML

services:
mysql:
image: mysql:8.4
container_name: muyu-mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: muyu2026
MYSQL_DATABASE: muyu_wms
TZ: Asia/Shanghai
ports:
- "${MYSQL_PORT:-13306}:3306"
volumes:
- ./mysql/init.sql:/docker-entrypoint-initdb.d/init.sql
- ../data/mysql:/var/lib/mysql
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: muyu-redis
restart: always
ports:
- "${REDIS_PORT:-16379}:6379"
volumes:
- ../data/redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
postgres:
image: postgres:16
container_name: muyu-postgres
restart: always
environment:
POSTGRES_USER: muyu
POSTGRES_PASSWORD: muyu2026
POSTGRES_DB: muyu_crm
TZ: Asia/Shanghai
ports:
- "5432:5432"
volumes:
- ./postgres/init-crm.sql:/docker-entrypoint-initdb.d/init.sql
- ../data/postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U muyu -d muyu_crm"]
interval: 10s
timeout: 5s
retries: 8
etcd:
image: quay.io/coreos/etcd:v3.5.17
container_name: muyu-etcd
restart: always
command:
- etcd
- --name=default
- --data-dir=/etcd-data
- --listen-client-urls=http://0.0.0.0:2379
- --advertise-client-urls=http://127.0.0.1:2379
- --listen-peer-urls=http://0.0.0.0:2380
- --initial-advertise-peer-urls=http://127.0.0.1:2380
- --initial-cluster=default=http://127.0.0.1:2380
- --initial-cluster-state=new
ports:
- "2379:2379"
healthcheck:
test: ["CMD", "etcdctl", "endpoint", "health"]
interval: 10s
timeout: 5s
retries: 5
system-rpc:
build:
context: ..
dockerfile: deploy/Dockerfile.system
container_name: muyu-system-rpc
restart: always
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
etcd:
condition: service_healthy
environment:
TZ: Asia/Shanghai
inventory-rpc:
build:
context: ..
dockerfile: deploy/Dockerfile.inventory
container_name: muyu-inventory-rpc
restart: always
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
etcd:
condition: service_healthy
environment:
TZ: Asia/Shanghai
purchase-rpc:
build:
context: ..
dockerfile: deploy/Dockerfile.purchase
container_name: muyu-purchase-rpc
restart: always
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
etcd:
condition: service_healthy
environment:
TZ: Asia/Shanghai
gateway:
build:
context: ..
dockerfile: deploy/Dockerfile.gateway
container_name: muyu-gateway
restart: always
ports:
- "8888:8888"
depends_on:
system-rpc:
condition: service_started
inventory-rpc:
condition: service_started
purchase-rpc:
condition: service_started
postgres:
condition: service_healthy
environment:
TZ: Asia/Shanghai
nginx:
image: nginx:alpine
container_name: muyu-nginx
restart: always
ports:
- "${NGINX_PORT:-18080}:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- ../../muyu-portal/dist:/usr/share/nginx/html
- ../data/uploads:/usr/share/nginx/uploads
depends_on:
- gateway