Skip to content

Commit

Permalink
Merge pull request #35 from cyber-dojo/fix-healthcheck-log-cropping
Browse files Browse the repository at this point in the history
Fix Docker healthcheck log file cropping
  • Loading branch information
JonJagger authored Jul 11, 2024
2 parents 7b66ccd + 1bbef4b commit a1704ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/config/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ readonly PORT="${CYBER_DOJO_RUNNER_PORT}"
readonly READY_LOG_FILENAME=/tmp/ready.log

wget http://0.0.0.0:${PORT}/ready -q -O - >> "${READY_LOG_FILENAME}" 2>&1
echo >> "${READY_LOG_FILENAME}" # add a newline

# keep only most recent 500 lines
sed -i '501,$ d' "${READY_LOG_FILENAME}"
tail -n500 "${READY_LOG_FILENAME}" > "${READY_LOG_FILENAME}.tmp"
mv "${READY_LOG_FILENAME}.tmp" "${READY_LOG_FILENAME}"

0 comments on commit a1704ba

Please sign in to comment.