Skip to content

Commit

Permalink
start-all.rst add documnetation on using --compose
Browse files Browse the repository at this point in the history
  • Loading branch information
amnonh committed Dec 3, 2023
1 parent 7397ce0 commit 3e4aed5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
3 changes: 0 additions & 3 deletions docker-compose.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ services:
- ${LOKI_WALL_DIR}:/wal:z
#LOKI_DIR
promotheus:
command:
- --config.file=/etc/prometheus/prometheus.yml
- --web.enable-lifecycle
#PROMETHEUS_COMMAND_LINE
#GENERAL_DOCER_CONFIG
#PROMETHEUS_USER_PERMISSIONS
Expand Down
2 changes: 2 additions & 0 deletions docs/source/install/start-all.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ You cannot use port mapping when using the ``-l`` flag

**--auto-restart** When set, Docker will automatically restart all the services inside the containers in case of a failure.

**--compose** This is an experimental option. When set, it initiates a two-stage process. Firstly, a ``docker-compose.yml`` file is created along with an ``.env`` file. Following this, the script executes ``docker-compose up``. Please note that having docker-compose is a prerequisite.

Grafana Related Commands
------------------------

Expand Down
16 changes: 13 additions & 3 deletions make-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ while getopts ':hleEd:g:p:v:s:n:a:c:j:b:m:r:R:M:G:D:L:N:C:Q:A:f:P:S:T:k:' option
if [ ! -d $LOKI_DIR ]; then
mkdir -p $LOKI_DIR
fi
LOKI_DIR="-v $LOKI_DIR:/tmp/loki:z"
LOKI_DIR="- $LOKI_DIR:/tmp/loki:z"
;;
:) printf "missing argument for -%s\n" "$OPTARG" >&2
echo "$usage" >&2
Expand Down Expand Up @@ -572,9 +572,19 @@ echo "LOKI_CONF_DIR=$LOKI_CONF_DIR">> .env
echo "LOKI_DIR=$LOKI_DIR">> .env
echo "LOKI_PORT=$LOKI_PORT">> .env
echo "LOKI_WALL_DIR=$LOKI_WALL_DIR">> .env
if [ "$VICTORIA_METRICS" = "1" ]; then
sed -i 's&prom/prometheus:${PROMETHEUS_VERSION}&victoriametrics/victoria-metrics:${VICTORIA_METRICS_VERSION}&' docker-compose.yml
sed -i 's&./prometheus/build/prometheus.yml:/etc/prometheus/prometheus.yml&./prometheus/build/prometheus.yml:/etc/promscrape.config.yml:z&' docker-compose.yml
PROMETHEUS_COMMAND_LINE_OPTIONS_ARRAY+=( -promscrape.config=/etc/promscrape.config.yml -promscrape.config.strictParse=false -httpListenAddr=:9090)
else
PROMETHEUS_COMMAND_LINE_OPTIONS_ARRAY+=(--config.file=/etc/prometheus/prometheus.yml --web.enable-lifecycle)
fi
PROMETHEUS_COMMAND_LINE=""
if (( ${#PROMETHEUS_COMMAND_LINE_OPTIONS_ARRAY[@]} )); then
PROMETHEUS_COMMAND_LINE=" command:\n"`add_param "${PROMETHEUS_COMMAND_LINE_OPTIONS_ARRAY[@]}"`
fi

val=`add_param "${PROMETHEUS_COMMAND_LINE_OPTIONS_ARRAY[@]}"`
sed -i "s/ *#PROMETHEUS_COMMAND_LINE/$val/" docker-compose.yml
sed -i "s& *#PROMETHEUS_COMMAND_LINE&$PROMETHEUS_COMMAND_LINE&" docker-compose.yml
val=`add_param "${PROMETHEUS_PROMETHEUS_VOLUMES_ARRAY[@]}"`
sed -i "s& *#PROMETHEUS_VOLUMES&$val&" docker-compose.yml

Expand Down

0 comments on commit 3e4aed5

Please sign in to comment.