first commit
This commit is contained in:
38
docker-compose.yml
Normal file
38
docker-compose.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
consul-client:
|
||||
image: hashicorp/consul:latest
|
||||
container_name: consul-client
|
||||
network_mode: host
|
||||
restart: always
|
||||
entrypoint: /bin/sh
|
||||
command: >
|
||||
-c "ETH0_IP=$$(ip -4 addr show eth0 | grep 'inet ' | head -n1 | awk '{print $$2}' | cut -d/ -f1) &&
|
||||
consul agent
|
||||
-data-dir=/consul/data
|
||||
-retry-join=192.168.4.226
|
||||
-retry-join=192.168.4.227
|
||||
-retry-join=192.168.4.228
|
||||
-retry-join=192.168.4.36
|
||||
-encrypt=AhKqpWcJGUHgj7x4gJPPTpvw859gbn/RTJINNeUDA2Q=
|
||||
-bind=$$ETH0_IP
|
||||
-advertise=$$ETH0_IP"
|
||||
|
||||
nomad-client:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: nomad-client
|
||||
network_mode: host
|
||||
privileged: true
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- consul-client
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./nomad-client.json:/etc/nomad/nomad.json:ro
|
||||
- /opt/nomad:/opt/nomad
|
||||
- /tmp:/tmp
|
||||
command: agent -config=/etc/nomad/nomad.json
|
||||
|
||||
Reference in New Issue
Block a user