services:
  master-node:
    image: ensync/master-node:latest
    depends_on:
      - config-manager
    ports:
      - "8082:8082"
      - "8443:8443"
    user: ${ENSYNC_UID}:${ENSYNC_GID}  # Use environment variables for UID/GID
    volumes:
      - ${STORAGE_DIR}:/records:rw  # Correct bind mount syntax
    environment:
      - ENSYNC_CLEAN_UP=${ENSYNC_CLEAN_UP:200}
      - ENSYNC_CLEAN_UP_TO=${ENSYNC_CLEAN_UP_TO:200}
    networks:
      - ensync-shared-network
    restart: unless-stopped
  config-manager:
    image: ensync/config-manager:latest
    ports:
      - "5001:5001"
      - "8080:8080"
    volumes:
      - ensync_data:/app/data
    networks:
      - ensync-shared-network
    restart: unless-stopped
networks:
  ensync-shared-network:
    driver: bridge
volumes:
  ensync_data:

