Skip to content

Instantly share code, notes, and snippets.

@moonape1226
Created March 21, 2022 10:27
Show Gist options
  • Save moonape1226/29eb6322784236176270d02ade90f291 to your computer and use it in GitHub Desktop.
Save moonape1226/29eb6322784236176270d02ade90f291 to your computer and use it in GitHub Desktop.
Nifi with auto recovery mechanism using docker compose
version: "3.5"
networks:
nifi:
services:
nifi:
cap_add:
- NET_ADMIN # low port bindings
image: apache/nifi:1.15.3
container_name: nifi
environment:
NIFI_WEB_HTTP_HOST: "0.0.0.0"
NIFI_WEB_HTTPS_HOST: "0.0.0.0"
NIFI_WEB_PROXY_HOST: "127.0.0.1:8443"
SINGLE_USER_CREDENTIALS_USERNAME: "admin"
SINGLE_USER_CREDENTIALS_PASSWORD: "***"
NIFI_JVM_HEAP_INIT: 8g
NIFI_JVM_HEAP_MAX: 12g
ports:
- "8080:8080/tcp" # HTTP interface
- "8443:8443/tcp" # HTTPS interface
networks:
- nifi
restart: always
labels:
- "autoheal=true"
healthcheck:
test: "${DOCKER_HEALTHCHECK_TEST:-curl -k https://localhost:8443/nifi/}"
interval: "60s"
timeout: "3s"
start_period: "5s"
retries: 5
logging:
driver: "local"
options:
max-file: "5"
max-size: "10m"
autoheal:
image: willfarrell/autoheal:1.2.0
tty: true
container_name: autoheal
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
AUTOHEAL_INTERVAL: 60 # check every 5 seconds
AUTOHEAL_START_PERIOD: 300 # wait 0 seconds before first health check
AUTOHEAL_DEFAULT_STOP_TIMEOUT: 120 # Docker waits max 10 seconds (the Docker default) for a container to stop before killing during restarts (container overridable via label, see below)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment