monorepo/cloud/infrastructure/development/docker-compose.dev.yml
2025-12-02 14:53:07 -05:00

257 lines
7.3 KiB
YAML

# Shared network for all Maple services in development
networks:
mapleopentech-dev:
name: mapleopentech-dev
driver: bridge
# Persistent volumes for development data
volumes:
cassandra-1-dev-data:
name: mapleopentech-cassandra-1-dev
cassandra-2-dev-data:
name: mapleopentech-cassandra-2-dev
cassandra-3-dev-data:
name: mapleopentech-cassandra-3-dev
redis-dev-data:
name: mapleopentech-redis-dev
meilisearch-dev-data:
name: mapleopentech-meilisearch-dev
seaweedfs-dev-data:
name: mapleopentech-seaweedfs-dev
mariadb-dev-data:
name: mapleopentech-mariadb-dev
wordpress-dev-data:
name: mapleopentech-wordpress-dev
services:
cassandra-1:
image: cassandra:5.0.4
container_name: mapleopentech-cassandra-1-dev
hostname: cassandra-1
ports:
- "9042:9042" # CQL native transport
- "9160:9160" # Thrift (legacy, optional)
environment:
- CASSANDRA_CLUSTER_NAME=mapleopentech-dev-cluster
- CASSANDRA_DC=datacenter1
- CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch
- CASSANDRA_SEEDS=cassandra-1,cassandra-2,cassandra-3
- MAX_HEAP_SIZE=512M
- HEAP_NEWSIZE=128M
volumes:
- cassandra-1-dev-data:/var/lib/cassandra
- ./cassandra/init-scripts:/init-scripts:ro
networks:
- mapleopentech-dev
healthcheck:
test: ["CMD-SHELL", "cqlsh -e 'describe cluster' || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 80s
restart: unless-stopped
cassandra-2:
image: cassandra:5.0.4
container_name: mapleopentech-cassandra-2-dev
hostname: cassandra-2
environment:
- CASSANDRA_CLUSTER_NAME=mapleopentech-dev-cluster
- CASSANDRA_DC=datacenter1
- CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch
- CASSANDRA_SEEDS=cassandra-1,cassandra-2,cassandra-3
- MAX_HEAP_SIZE=512M
- HEAP_NEWSIZE=128M
volumes:
- cassandra-2-dev-data:/var/lib/cassandra
networks:
- mapleopentech-dev
depends_on:
- cassandra-1
healthcheck:
test: ["CMD-SHELL", "cqlsh -e 'describe cluster' || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 80s
restart: unless-stopped
cassandra-3:
image: cassandra:5.0.4
container_name: mapleopentech-cassandra-3-dev
hostname: cassandra-3
environment:
- CASSANDRA_CLUSTER_NAME=mapleopentech-dev-cluster
- CASSANDRA_DC=datacenter1
- CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch
- CASSANDRA_SEEDS=cassandra-1,cassandra-2,cassandra-3
- MAX_HEAP_SIZE=512M
- HEAP_NEWSIZE=128M
volumes:
- cassandra-3-dev-data:/var/lib/cassandra
networks:
- mapleopentech-dev
depends_on:
- cassandra-1
healthcheck:
test: ["CMD-SHELL", "cqlsh -e 'describe cluster' || exit 1"]
interval: 30s
timeout: 10s
retries: 5
start_period: 80s
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: mapleopentech-redis-dev
hostname: redis
ports:
- "6379:6379"
volumes:
- redis-dev-data:/data
- ./redis/redis.dev.conf:/usr/local/etc/redis/redis.conf:ro
networks:
- mapleopentech-dev
command: redis-server /usr/local/etc/redis/redis.conf
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
restart: unless-stopped
meilisearch:
image: getmeili/meilisearch:v1.5
container_name: mapleopentech-meilisearch-dev
hostname: meilisearch
ports:
- "7700:7700"
environment:
- MEILI_ENV=development
- MEILI_MASTER_KEY=mapleopentech-dev-master-key-change-in-production
- MEILI_NO_ANALYTICS=true
volumes:
- meilisearch-dev-data:/meili_data
networks:
- mapleopentech-dev
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7700/health"]
interval: 10s
timeout: 3s
retries: 3
restart: unless-stopped
seaweedfs:
image: chrislusf/seaweedfs:latest
container_name: mapleopentech-seaweedfs-dev
hostname: seaweedfs
ports:
- "8333:8333" # S3 API
- "9333:9333" # Master server (web UI)
- "8080:8080" # Volume server
environment:
- WEED_MASTER_VOLUME_SIZE_LIMIT_MB=1024
volumes:
- seaweedfs-dev-data:/data
networks:
- mapleopentech-dev
command: server -s3 -dir=/data -s3.port=8333 -ip=0.0.0.0
healthcheck:
test:
[
"CMD",
"/usr/bin/wget",
"-q",
"--spider",
"http://127.0.0.1:9333/cluster/status",
]
interval: 10s
timeout: 3s
retries: 3
start_period: 15s
restart: unless-stopped
# Nginx - CORS proxy for SeaweedFS
# Access: localhost:8334 (proxies to seaweedfs:8333 with CORS headers)
# Use this endpoint from frontend for file uploads
nginx-s3-proxy:
image: nginx:alpine
container_name: mapleopentech-nginx-s3-proxy-dev
hostname: nginx-s3-proxy
ports:
- "8334:8334" # CORS-enabled S3 API proxy
volumes:
- ./nginx/seaweedfs-cors.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- mapleopentech-dev
depends_on:
- seaweedfs
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8334/"]
interval: 10s
timeout: 3s
retries: 3
restart: unless-stopped
# MariaDB - WordPress database
# Access: localhost:3306
# Credentials: wordpress/wordpress (root: mapleopentech-dev-root-password)
mariadb:
image: mariadb:11.2
container_name: mapleopentech-mariadb-dev
hostname: mariadb
ports:
- "3306:3306"
environment:
- MARIADB_ROOT_PASSWORD=mapleopentech-dev-root-password
- MARIADB_DATABASE=wordpress
- MARIADB_USER=wordpress
- MARIADB_PASSWORD=wordpress
volumes:
- mariadb-dev-data:/var/lib/mysql
networks:
- mapleopentech-dev
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 10s
timeout: 3s
retries: 5
start_period: 30s
restart: unless-stopped
# WordPress - Plugin development and testing
# Access: http://localhost:8081
# Plugin auto-mounted from: native/wordpress/maplepress-plugin
# Debug logs: docker exec -it mapleopentech-wordpress-dev tail -f /var/www/html/wp-content/debug.log
wordpress:
image: wordpress:latest
container_name: mapleopentech-wordpress-dev
hostname: wordpress
ports:
- "8081:80"
environment:
- WORDPRESS_DB_HOST=mariadb:3306
- WORDPRESS_DB_USER=wordpress
- WORDPRESS_DB_PASSWORD=wordpress
- WORDPRESS_DB_NAME=wordpress
- WORDPRESS_DEBUG=1
- WORDPRESS_CONFIG_EXTRA=
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
volumes:
- wordpress-dev-data:/var/www/html
# MaplePress plugin - mounted read-only for live development
- ../../../native/wordpress/maplepress-plugin:/var/www/html/wp-content/plugins/maplepress-plugin:ro
networks:
- mapleopentech-dev
depends_on:
mariadb:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
restart: unless-stopped