With PWS shutting down, I& #39;ve started work on moving some websites over to AWS. The first (my C4 model online training course) is a pretty straightforward Spring Boot app / MySQL database combo. Here& #39;s the current deployment diagram.
Since I& #39;m already using AWS, I& #39;ve decided to wrap the Spring Boot app in a Docker container, and deploy it onto AWS ECS, via Fargate. I& #39;ll post an updated deployment diagram later, so you can see how I& #39;d document that deployment approach, since I imagine it& #39;s pretty common.
Deploying a Docker container on Fargate was relatively straightforward, although a bit frustrating in places ... AWS moves so fast, so many of the blog posts and StackOverflow questions are out of date.
But I now have the ECS CLI installed, my Docker & ECS compose configuration scripted, and it& #39;s easy to push updates. I& #39;ve also created an AWS Application Load Balancer to route requests to the Docker container, although this was even more frustrating!
Again, much of what you& #39;ll read online is out of date, referencing older ECS CLI parameters such as --load-balancer and --target-group-arn (these are both deprecated). But I finally got that all to work.
While testing, I noticed that the Spring Boot app was really slow. Initially I& #39;d undersized the task size, so I fixed that. But then I noticed that the app would only respond to about half of the requests. Weirdly the app seemed to be restarting every few minutes.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🤷‍♂️" title="Achselzuckender Mann" aria-label="Emoji: Achselzuckender Mann">
It turns out that was exactly the case. I& #39;d set the ALB health check to a page that returned a HTTP 302 (redirect) rather than a 200 ... so the app really was being restarted every few minutes.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🤣" title="Lachend auf dem Boden rollen" aria-label="Emoji: Lachend auf dem Boden rollen">
I miss my "cf push" already.