feat: docker-compose.yml with registry and mongo
This commit is contained in:
parent
b2a4b33e7d
commit
b5f8488af3
3 changed files with 28 additions and 4 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
25
docker-compose.yml
Normal file
25
docker-compose.yml
Normal file
|
|
@ -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"
|
||||
Loading…
Reference in a new issue