0

I'm looking for a docker container which can run a Java application. However, this should automatically pull updates from a GitHub repository. I had the following features in mind for a Workflow:

  • Watching on a (private) GitHub repo for merges in main
  • stopping active java app
  • Fetching the GitHub repo
  • building the Source Code (maven)
  • updating DB structure if needed
  • executing the new jar

Does something like this already exist or do I have to build it from scratch? I've been looking for a way to implement this workflow for my Java discord bot for so long and haven't found anything yet.

I would be very grateful for tips or similar.

  • Build new docker images with new versions of the code. Then update your servers to run the new code. Docker images should be treated as immutable and containers ephemeral. The database updates can happen on container startup – erik258 Jan 19 '22 at 05:58
  • Any capable build system should be able to orchestrate this outside the container. Downtime in the way you describe it will cause unacceptable downtime except for the most trivial cases. – Thorbjørn Ravn Andersen Jan 19 '22 at 07:35
  • I am not sure you are targetting the right technology here : docker is single process - stateless oriented. If you want more processes (update, run, compile, etc), you should consider using docker-compose at least. But your gitlab code should be externalized (eg through a volume mounting). And about triggers (application 1 stopping application 2 on specific condition) : docker is not suited at all (to my pov). What you describe sounds like continuous integration, and there are frameworks dedicated to such tasks (such as Jenkins or Gitlab-ci... and so many more) – Marvin Jan 19 '22 at 08:11

0 Answers0