Skip to content

Commit fb3d0f5

Browse files
committed
make docker compose named and try and avoid port clashes. Pass through env variables required for non-showcase
1 parent 4a7fdad commit fb3d0f5

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To help getting started we have created a few docker compose files that orchestr
1212
Run the docker command below from the `src` folder in a terminal.
1313

1414
```cmd
15-
docker compose -f docker-compose-base.yml -f compose-rabbitmq.yml --env-file rabbit.env up -d
15+
docker compose -p particular-platform-showcase -f docker-compose-base.yml -f compose-rabbitmq.yml --env-file rabbit.env up -d
1616
```
1717

1818
### (Alternative) Run in Docker against **Azure Service Bus**
@@ -28,7 +28,7 @@ CONNECTIONSTRING="Endpoint=sb://[NAMESPACE].servicebus.windows.net/;SharedAccess
2828
Run docker command below from the `src` folder in a terminal.
2929

3030
```cmd
31-
docker compose -f docker-compose-base.yml -f compose-azure.yml --env-file asb.env up -d
31+
docker compose -p particular-platform-showcase -f docker-compose-base.yml -f compose-azure.yml --env-file asb.env up -d
3232
```
3333

3434
</details>
@@ -46,15 +46,15 @@ To start the required infrastructure for the showcase, run one of the docker com
4646
RabbitMQ
4747

4848
```cmd
49-
docker compose -f docker-compose-base.yml -f compose-rabbitmq.yml --env-file rabbit.env --profile infrastructure --profile frontend up -d
49+
docker compose -p particular-platform-showcase -f docker-compose-base.yml -f compose-rabbitmq.yml --env-file rabbit.env --profile infrastructure --profile frontend up -d
5050
```
5151

5252
Azure Service Bus
5353

5454
See [ASB setup](#alternative-run-from-azure-service-bus) above for setting the connection string to your Azure Service Bus namespace
5555

5656
```cmd
57-
docker compose -f docker-compose-base.yml -f compose-azure.yml --env-file asb.env --profile infrastructure --profile frontend up -d
57+
docker compose -p particular-platform-showcase -f docker-compose-base.yml -f compose-azure.yml --env-file asb.env --profile infrastructure --profile frontend up -d
5858
```
5959

6060
After opening the solution (from Visual Studio or Rider), choose one of the run profiles that matches the transport configured previously:

src/compose-rabbitmq-user.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
services:
2+
masstransit-connector:
3+
environment:
4+
- RABBITMQ_MANAGEMENT_API_URL
5+
- RABBITMQ_MANAGEMENT_API_USERNAME
6+
- RABBITMQ_MANAGEMENT_API_PASSWORD
7+
service-control:
8+
environment:
9+
- LICENSINGCOMPONENT_RABBITMQ_APIURL=${RABBITMQ_MANAGEMENT_API_URL}
10+
- LICENSINGCOMPONENT_RABBITMQ_USERNAME=${RABBITMQ_MANAGEMENT_API_USERNAME}
11+
- LICENSINGCOMPONENT_RABBITMQ_PASSWORD=${RABBITMQ_MANAGEMENT_API_PASSWORD}

src/compose-rabbitmq.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ services:
2121
- rabbitmq-logs:/var/log/rabbitmq
2222
ports:
2323
- 33721:5672
24-
- 15672:15672
24+
- 33672:15672
2525
configs:
2626
- source: plugins
2727
target: /etc/rabbitmq/enabled_plugins
@@ -30,6 +30,10 @@ services:
3030
depends_on:
3131
rabbitmq:
3232
condition: service_healthy
33+
environment:
34+
- LICENSINGCOMPONENT_RABBITMQ_APIURL=${RABBITMQ_MANAGEMENT_API_URL}
35+
- LICENSINGCOMPONENT_RABBITMQ_USERNAME=${RABBITMQ_MANAGEMENT_API_USERNAME}
36+
- LICENSINGCOMPONENT_RABBITMQ_PASSWORD=${RABBITMQ_MANAGEMENT_API_PASSWORD}
3337

3438
masstransit-connector:
3539
environment:

src/frontend/public/rabbit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Running with your own RabbitMQ system
22

33
1. Open the `src/rabbit.env` file in an editor and update the RabbitMQ configuration to point to your own RabbitMQ instance.
4-
1. `CONNECTION_STRING` A special connection string to connect to RabbtiMQ, see https://docs.particular.net/servicecontrol/transports#rabbitmq for syntax format.
4+
1. `CONNECTION_STRING` A special connection string to connect to RabbitMQ, see https://docs.particular.net/servicecontrol/transports#rabbitmq for syntax format.
55
2. `RABBITMQ_MANAGEMENT_API_URL` The management API URL.
66
3. `RABBITMQ_MANAGEMENT_API_USERNAME` The management API username.
77
4. `RABBITMQ_MANAGEMENT_API_PASSWORD` The management API password.
@@ -10,5 +10,5 @@
1010

1111
```cmd
1212
docker compose -f docker-compose-base.yml -f compose-rabbitmq.yml --env-file rabbit.env down
13-
docker compose -f docker-compose-base.yml --env-file rabbit.env --profile infrastructure up
13+
docker compose -p particular-platform -f docker-compose-base.yml -f compose_rabbitmq-user.yml --env-file rabbit.env --profile infrastructure up
1414
```

src/rabbit.env

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ CONNECTION_STRING="host=rabbitmq"
55
RABBITMQ_MANAGEMENT_API_URL="http://rabbitmq:15672"
66
RABBITMQ_MANAGEMENT_API_USERNAME=guest
77
RABBITMQ_MANAGEMENT_API_PASSWORD=guest
8+
9+
#Only used for the showcase processes
10+
RABBITMQ_HOST="rabbitmq"
11+
RABBITMQ_PORT="5672"
12+
RABBITMQ_VIRTUALHOST="/"

0 commit comments

Comments
 (0)