-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(docker-jans-monolith): improve monolith behavior during restarts #8502
Conversation
- restart (or stop then start): CMD in Dockerfile will now clean the jetty temp directory to prevent disk size grow - down then up: added scripts (down.sh and up.sh) that create a post installation image on a down and use it on a later up such that only first up runs the installation script - clean: added clean.sh script to remove all docker artifacts (allows for a fresh start) - Guidelines: Updated README.md and Guiding echoes in startjanssenmonolithdemo.sh - host mounted log files: The log files are now mounted on the host to improve access to them and being capable to delete them easily
@tawaren thanks for submitting the PR. Can you please add the DCO to your commit? |
Signed-off-by: Mohammad Abudayyeh <47318409+moabu@users.noreply.github.com>
docker-jans-monolith/up.sh
Outdated
fi | ||
|
||
export JANSSEN_IMAGE | ||
docker compose -f ${yaml} up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make more sense to run this in detached mode.
echo -e "To clean up run:" | ||
echo -e "docker compose -f /tmp/jans/docker-jans-monolith/jans-mysql-compose.yml down && rm -rf /tmp/jans" | ||
echo -e "or docker compose -f /tmp/jans/docker-jans-monolith/jans-postgres-compose.yml down && rm -rf /tmp/jans" | ||
echo -e "/tmp/jans/docker-jans-monolith/clean.sh mysql rm && -rf /tmp/jans" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems a typo of placing rm
before &&
.
elif [[ $JANS_PERSISTENCE == "LDAP" ]]; then | ||
docker compose -f /tmp/jans/docker-jans-monolith/jans-ldap-compose.yml up -d | ||
fi | ||
/tmp/jans/docker-jans-monolith/up.sh ldap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing fi
syntax.
@@ -72,12 +72,11 @@ if [[ "$JANS_BUILD_COMMIT" ]]; then | |||
fi | |||
# -- | |||
if [[ $JANS_PERSISTENCE == "MYSQL" ]]; then | |||
docker compose -f /tmp/jans/docker-jans-monolith/jans-mysql-compose.yml up -d | |||
/tmp/jans/docker-jans-monolith/up.sh mysql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running the up.sh
script will throw Permission denied
because it's not executable. Probably run the script with bash /tmp/jans/...
instead.
Merging changes since fork into pull request
…to ReliableRestarts
- rm after && in command hint - starting up in detached mode - stating bash explicitly for executing the scripts - added missing fi Signed-off-by: Markus Knecht markus.knecht85@gmail.com
I added the requested changes |
Signed-off-by: Markus Knecht <markus.knecht85@gmail.com>
Changed the misstyping in the variable names |
Description
Improved restarting (docker stop/start & docker compose down/up) behaviour. The monolith can now be restarted after a down without the need to run the install script again. Further, the container can be restarted without leading to an increease in the containers size.
Target issue
Ref: Diskspace usage increate after restart #8414
Implementation Details
Signed-off-by: Markus Knecht markus.knecht85@gmail.com