Hexagonal Architecture Practicing
![zeroMQ Hexagonal Architecture](./zmq-pic.png)
Run in docker environment
- first create base docker image
docker build -t golang-alpine-libzmq:1.8.3 -f golang-alpine:1.8.3.libzmq.Dockerfile .
docker build -t alpine.libzmq:3 -f alpine.libzmq.Dockerfile .
- set your config in
.env
file.
.
|-- broker
| |-- ...
| |-- .env
| `-- start.sh
|
|-- publisher
| |-- ...
| |-- .env
| `-- start.sh
|
|-- subscriber
| |-- ...
| |-- .env
| `-- start.sh
|
|
|-- README.md
|-- ...
|-- go.mod
|-- go.sum
- set +X permission to
.sh
file
chmod 710 broker.build.sh
chmod 710 publisher.build.sh
chmod 710 subscriber.build.sh
chmod 710 broker/start.sh
chmod 710 publisher/start.sh
chmod 710 subscriber/start.sh
- build images
./broker.build.sh
./publisher.build.sh
./subscriber.build.sh
- create
zmqgh-network
network
docker network create zmqgh-network
- run containers.you must change dir to each folder and exec start.
cd broker
- to run each container in background add
-d
to docker run command in start.sh