############################# # Ports Exposed # 4000 - Imex Node API # 4556 - LocalStack (Local AWS) # 3333 - SocketIO Admin-UI (Optional) # 3334 - Redis-Insights (Optional) ############################# services: # Redis Node 1 redis-node-1: build: context: ./redis container_name: redis-node-1 hostname: redis-node-1 restart: unless-stopped networks: - redis-cluster-net volumes: - redis-node-1-data:/data - redis-lock:/redis-lock healthcheck: test: [ "CMD", "sh", "-c", "redis-cli ping && redis-cli cluster info | grep cluster_state:ok" ] interval: 10s timeout: 5s retries: 10 start_period: 15s # Redis Node 2 redis-node-2: build: context: ./redis container_name: redis-node-2 hostname: redis-node-2 restart: unless-stopped networks: - redis-cluster-net volumes: - redis-node-2-data:/data - redis-lock:/redis-lock healthcheck: test: [ "CMD", "sh", "-c", "redis-cli ping && redis-cli cluster info | grep cluster_state:ok" ] interval: 10s timeout: 5s retries: 10 start_period: 15s # Redis Node 3 redis-node-3: build: context: ./redis container_name: redis-node-3 hostname: redis-node-3 restart: unless-stopped networks: - redis-cluster-net volumes: - redis-node-3-data:/data - redis-lock:/redis-lock healthcheck: test: [ "CMD", "sh", "-c", "redis-cli ping && redis-cli cluster info | grep cluster_state:ok" ] interval: 10s timeout: 5s retries: 10 start_period: 15s # LocalStack: Used to emulate AWS services locally, currently setup for SES # Notes: Set the ENV Debug to 1 for additional logging localstack: image: localstack/localstack:4.13.1 container_name: localstack hostname: localstack networks: - redis-cluster-net restart: unless-stopped volumes: - ./certs:/tmp/certs:ro # only if your script reads /tmp/certs/... - ./localstack/init:/etc/localstack/init/ready.d:ro - /var/run/docker.sock:/var/run/docker.sock env_file: - .env.localstack.docker ports: - "4566:4566" healthcheck: test: [ "CMD", "curl", "-f", "http://localhost:4566/_localstack/health" ] interval: 10s timeout: 5s retries: 5 start_period: 20s # Node App: The Main IMEX API node-app: build: context: . container_name: node-app hostname: imex-api networks: - redis-cluster-net env_file: - .env.development depends_on: redis-node-1: condition: service_healthy redis-node-2: condition: service_healthy redis-node-3: condition: service_healthy localstack: condition: service_healthy ports: - "4000:4000" - "9229:9229" volumes: - .:/app - node-app-npm-cache:/app/node_modules # ## Optional Container to Observe SocketIO data # socketio-admin-ui: # image: maitrungduc1410/socket.io-admin-ui # container_name: socketio-admin-ui # networks: # - redis-cluster-net # ports: # - "3333:80" # ##Optional Container to Observe Redis Cluster Data # redis-insight: # image: redislabs/redisinsight:latest # container_name: redis-insight # hostname: redis-insight # restart: unless-stopped # ports: # - "3334:5540" # networks: # - redis-cluster-net # volumes: # - redis-insight-data:/db # ##Optional Container for SFTP/SSH Server for testing # ssh-sftp-server: # image: atmoz/sftp:alpine # Using an image with SFTP support # container_name: ssh-sftp-server # hostname: ssh-sftp-server # networks: # - redis-cluster-net # ports: # - "2222:22" # Expose port 22 for SSH/SFTP (mapped to 2222 on the host) # volumes: # - ./certs/io-ftp-test.key.pub:/home/user/.ssh/keys/io-ftp-test.key.pub:ro # Mount the SSH public key as authorized_keys # - ./upload:/home/user/upload # Mount a local directory for SFTP uploads # environment: # # - SFTP_USERS=user::1000::upload # - SFTP_USERS=user:password:1000::upload # command: > # /bin/sh -c " # chmod -R 007 /home/user/upload && # echo 'Match User user' >> /etc/ssh/sshd_config && # sed -i -e 's#ForceCommand internal-sftp#ForceCommand internal-sftp -d /upload#' /etc/ssh/sshd_config && # /usr/sbin/sshd -D # " networks: redis-cluster-net: driver: bridge volumes: node-app-npm-cache: redis-node-1-data: redis-node-2-data: redis-node-3-data: redis-lock: redis-insight-data: