diff --git a/README.md b/README.md index 613b533..6e52f66 100644 --- a/README.md +++ b/README.md @@ -70,11 +70,11 @@ You can build and run the service using Docker: # Build the Docker image docker build -t registry . -# Run the container -docker run -p 8080:8080 registry +# Run the registry and MongoDB with docker compose +docker compose up ``` -This will build and start the MCP Registry service in a container, exposing it on port 8080. +This will start the MCP Registry service and MongoDB with Docker, exposing it on port 8080. ### Using the Fake Service diff --git a/cmd/registry/main.go b/cmd/registry/main.go index 050b07b..94f0957 100644 --- a/cmd/registry/main.go +++ b/cmd/registry/main.go @@ -75,7 +75,6 @@ func main() { // Start server in a goroutine so it doesn't block signal handling go func() { - log.Printf("HTTP server listening on %s", cfg.ServerAddress) if err := server.Start(); err != nil && err != http.ErrServerClosed { log.Fatalf("Failed to start server: %v", err) } diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..852254f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,25 @@ +services: + registry: + image: registry + container_name: registry + links: + - mongodb + depends_on: + - mongodb + environment: + - MCP_REGISTRY_DATABASE_URL=mongodb://mongodb:27017 + - MCP_REGISTRY_ENVIRONMENT=test + ports: + - 8080:8080 + restart: "unless-stopped" + mongodb: + image: mongo + container_name: mongodb + environment: + - PUID=1000 + - PGID=1000 + volumes: + - './data:/data/db' + ports: + - 27017:27017 + restart: "unless-stopped"