When deploying Graylog using “docker stack deploy” it fails the healthcheck (apparently) if we set the http_publish_uri to anything other than 127.0.0.1, even though it starts successfully it will always fail after 120 seconds and quit, the problem is that this uri is not what we want to set, and the REST service then creates wrong urls…
This also does NOT happen if I use “docker-compose up”, this only happens if I use “docker stack deploy”, with nothing else getting changed. On docker-compose up the service starts succesfully with values other than 127.0.0.1.
If instead of setting my desired publish uri I set it to 127.0.0.1 the service goes up successfully.
Compose file version 3
Docker version 20.10.8
Deploying using docker stack deploy.
Mounted configuration file is default values with the exception of passwords and smtp values.
NOTE: For all container-based deployments, please include your full, redacted YAML configuration file
version: '3' services: # MongoDB: https://hub.docker.com/_/mongo/ mongo: image: mongo:4.2 deploy: mode: replicated replicas: 1 volumes: - mongo_data:/data/db networks: - graylog-network # Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/7.10/docker.html elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2 volumes: - es_data:/usr/share/elasticsearch/data environment: - http.host=0.0.0.0 - discovery.type=single-node - transport.host=localhost - network.host=0.0.0.0 - "ES_JAVA_OPTS=-Xms512m -Xmx512m" ulimits: memlock: soft: -1 hard: -1 deploy: mode: replicated replicas: 1 resources: limits: memory: 1g networks: - graylog-network # Graylog: https://hub.docker.com/r/graylog/graylog/ graylog: image: graylog/graylog:4.1 deploy: mode: replicated replicas: 1 volumes: - graylog_data:/usr/share/graylog/data - /docker/graylog/config:/usr/share/graylog/data/config environment: - GRAYLOG_HTTP_EXTERNAL_URI=https://myurl.com/ - GRAYLOG_HTTP_PUBLISH_URI=https://myurl.com/ entrypoint: /usr/bin/tini -- wait-for-it elasticsearch:9200 -- /docker-entrypoint.sh networks: - graylog-network depends_on: - mongo - elasticsearch ports: # Graylog web interface and REST API - 9000:9000 # Syslog TCP - 1514:1514 # Syslog UDP - 1514:1514/udp # GELF TCP - 12201:12201 # GELF UDP - 12201:12201/udp # Log Ports - 5555:5555 - 5555:5555/udp networks: graylog-network: driver: overlay volumes: mongo_data: driver: local es_data: driver: local graylog_data: driver: local
Starting the stack with:
docker stack deploy --compose-file docker-compose.yml graylog
Edit: I just disabled healthcheck to test and the container stays up, but fails to respond, I’m clueless as to why it fails with “docker stack deploy” but works with “docker-compose up”.