version: "3.8"
services:
  vault-1:
    image: vault
    container_name: vault-1    
    ports:
      - "8200:8200"
    restart: unless-stopped
    volumes:
      - /gurulandia/data/docker/vault-1/logs:/vault/logs
      - /gurulandia/data/docker/vault-1/file:/vault/file
      - /gurulandia/data/docker/vault-1/config:/vault/config
    cap_add:
      - IPC_LOCK
    entrypoint: vault server -config=/vault/config
    networks:
      vault-network:
        ipv4_address: 172.21.0.10
  vault-2:
    image: vault
    container_name: vault-2
    ports:
      - "53220:8200"
    environment:
       VAULT_TOKEN: hvs.CAESIBbD2GtLdO2bF-e3KttPqPjwbZ94LKuEvm1o3TxUB9X3Gh4KHGh2cy5vSHBSMEJNSUFpUjJnQjU0cGVsckpkUTc
       VAULT_ADDR: "http://0.0.0.0:5320"
    restart: unless-stopped
    volumes:
      - /gurulandia/data/docker/vault-2/logs:/vault/logs
      - /gurulandia/data/docker/vault-2/file:/vault/file
      - /gurulandia/data/docker/vault-2/config:/vault/config
    cap_add:
      - IPC_LOCK
    entrypoint: vault server -config=/vault/config
    networks:
      vault-network:
        ipv4_address: 172.21.0.11
#
#  vault-server:
#    image: vault:latest
#    ports:
#      - "8200:8200"
#    environment:
#      VAULT_ADDR: "http://0.0.0.0:8200"
#      VAULT_DEV_ROOT_TOKEN_ID: "vault-plaintext-root-token"
#    cap_add:
#      - IPC_LOCK
#    networks:
#      vault-network:
#        ipv4_address: 172.21.0.10
#        aliases:
#          - vault-server
#  vault-client:
#    build: .
#    environment:
#      VAULT_ADDR: "http://vault-server:8200"
#    networks:
#      vault-network:
#        ipv4_address: 172.21.0.20
#        aliases:
#          - vault-client
networks:
  vault-network:
    ipam:
      config:
        - subnet: 172.21.0.0/24
