|
| 1 | +# Docker Compose Setup for mnestix-proxy |
| 2 | + |
| 3 | +This guide explains how to use Docker Compose to run the full Mnestix Proxy stack, including the proxy, API, AAS environment, discovery, registry, and MongoDB. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Compose Files |
| 8 | + |
| 9 | +- **compose.yml**: For production or standard usage. Uses pre-built images. |
| 10 | +- **compose.dev.yml**: For development. Builds the `mnestix-proxy` image from your local source. |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## Prerequisites |
| 15 | + |
| 16 | +- [Docker](https://docs.docker.com/get-docker/) installed |
| 17 | +- [Docker Compose](https://docs.docker.com/compose/install/) (or use `docker compose` command with Docker Desktop) |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## Usage |
| 22 | + |
| 23 | +### 1. Standard Setup |
| 24 | + |
| 25 | +From the project root, run: |
| 26 | + |
| 27 | +```sh |
| 28 | +docker compose up |
| 29 | +``` |
| 30 | + |
| 31 | +This will start all services using pre-built images. |
| 32 | + |
| 33 | +### 2. Development Setup |
| 34 | + |
| 35 | +To build and run the proxy from your local source (using `compose.dev.yml`): |
| 36 | + |
| 37 | +```sh |
| 38 | +docker compose -f compose.yml -f compose.dev.yml up --build |
| 39 | +``` |
| 40 | + |
| 41 | +This will build the `mnestix-proxy` image from your local Dockerfile and start all services. The development compose file also exposes all service ports for easier debugging. |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## Services Overview |
| 46 | + |
| 47 | +- **mnestix-proxy**: Main reverse proxy gateway (`5065:5065`) |
| 48 | +- **mnestix-api**: Backend API service (`5064:5064`) |
| 49 | +- **mongodb**: MongoDB database for AAS and discovery services (`27017:27017`) |
| 50 | +- **aas-environment**: Eclipse BaSyx AAS environment (repository) (`8081:8081`) |
| 51 | +- **aas-discovery**: Eclipse BaSyx AAS discovery service (`8082:8081`) |
| 52 | +- **aas-registry**: Eclipse BaSyx AAS registry (`8083:8080`) |
| 53 | +- **submodel-registry**: Eclipse BaSyx submodel registry (`8084:8080`) |
| 54 | + |
| 55 | +All services are connected via the `mnestix-network` Docker network. |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +## Accessing Services |
| 60 | + |
| 61 | +- **Proxy**: [http://localhost:5065](http://localhost:5065) |
| 62 | +- **API**: [http://localhost:5064](http://localhost:5064) |
| 63 | +- **AAS Environment**: [http://localhost:8081](http://localhost:8081) |
| 64 | +- **AAS Discovery**: [http://localhost:8082](http://localhost:8082) |
| 65 | +- **AAS Registry**: [http://localhost:8083](http://localhost:8083) |
| 66 | +- **Submodel Registry**: [http://localhost:8084](http://localhost:8084) |
| 67 | +- **MongoDB**: [localhost:27017](http://localhost:27017) |
| 68 | + |
| 69 | +--- |
| 70 | + |
| 71 | +## Environment Variables |
| 72 | + |
| 73 | +You can override default settings using environment variables, e.g.: |
| 74 | +- `MNESTIX_BACKEND_API_KEY`: API key for secured endpoints |
| 75 | + |
| 76 | +See `compose.yml` and `compose.dev.yml` for all configurable variables. |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +## Stopping the Stack |
| 81 | + |
| 82 | +To stop and remove all containers: |
| 83 | + |
| 84 | +```sh |
| 85 | +docker compose down |
| 86 | +``` |
| 87 | + |
| 88 | +--- |
| 89 | + |
| 90 | +## Troubleshooting |
| 91 | + |
| 92 | +- View logs: `docker compose logs` |
| 93 | +- Check health status: Services use health checks to ensure readiness. |
| 94 | +- Make sure required ports are available and not blocked. |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +## Customization |
| 99 | + |
| 100 | +- Edit `compose.yml` or `compose.dev.yml` to change ports, images, or environment variables. |
| 101 | +- Update `mnestix-proxy/appsettings.json` for proxy configuration. |
| 102 | + |
| 103 | +--- |
| 104 | + |
| 105 | +## References |
| 106 | + |
| 107 | +- [compose.yml](../compose.yml) |
| 108 | +- [compose.dev.yml](../compose.dev.yml) |
| 109 | +- [mnestix-proxy/appsettings.json](../mnestix-proxy/appsettings.json) |
0 commit comments