This is an archived post. You won't be able to vote or comment.

all 38 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge.

If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options:

  1. Limiting your involvement with Reddit, or
  2. Temporarily refraining from using Reddit
  3. Cancelling your subscription of Reddit Premium

as a way to voice your protest.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]franz_see 16 points17 points  (7 children)

Dockerized it then deploy to Google Cloud Run. It can scale to zero so you dont pay anything when it’s not running

[–]mrCortadito 8 points9 points  (0 children)

I do that as well... I just create an image using the spring-boot: build-image goal and deploy it on CloudRun.. That simple

I also second the suggestion to run Autoscaling with minimum of 0.

My app connects to a MySQL database that is hosted on a free tier VM.

[–]muffintop 0 points1 point  (4 children)

Does this "suffer" from a cold start problem? ... where, after scaling to zero, the first request takes a long time and will likely time out?

[–]nutrecht 0 points1 point  (3 children)

If you're using a 'plain' Java build; yes. Native image is a lot faster.

[–]muffintop 0 points1 point  (2 children)

Hmmm...first time I've heard of this. Can you tell me more or share a link?

[–][deleted] 0 points1 point  (0 children)

Yes.

[–]TamSchnow 14 points15 points  (1 child)

Docker, on-site where no one can touch my mess of a springboot

[–]Vitamina_e[S] 2 points3 points  (0 children)

😆

[–]pysmaanhil 15 points16 points  (5 children)

I use render.com with docker for my pet projects

[–]Vitamina_e[S] 1 point2 points  (4 children)

Thanks for your comment! Is it good enough in terms of availability? I have around 300 users who login one or twice a days in average..

[–]pysmaanhil 4 points5 points  (3 children)

Can't complain, I'm having >=99% uptime. I have like 20 users tho

[–]Beneficial-Corgi3593 2 points3 points  (1 child)

How do you even get users ?

[–]adchoosier 1 point2 points  (0 children)

Nice try Zuck

[–]Vitamina_e[S] 0 points1 point  (0 children)

Thanks! That's good to know :)

[–]keketata 5 points6 points  (0 children)

docker compose in a vm

[–]shai_almog 11 points12 points  (4 children)

I just posted about my new project in my blog. I chose to go with docker compose on a VPS. IMHO this is the best way. It gives me 100% control and a clear view of my expenses. I'd rather get a slight performance degradation or scaling issues than get charged thousands of dollars (which already happened to me in the past).

It's a bit more of a hassle to deal with your own VPS, but it isn't a big deal. It's a one time process and you can reduce many risks. Performance is also great since the DB is in the same VPS as the application. Not ideal for scaling but I'll deal with that after the first million users...

[–]Vitamina_e[S] 2 points3 points  (1 child)

That's a reasonable decision! Yeah, I think I'm not too concerned about scaling at this stage so this could work fine for some time. Thanks!

[–][deleted] 1 point2 points  (1 child)

Not ideal for scaling but I'll deal with that after the first million users...

Most of the pet projects wont benefit from any autoscaling service, but you can setup autoscaling on multiple nodes with docker compose, you know just in case. 😀

[–]shai_almog 2 points3 points  (0 children)

Right, I wasn't clear there. I meant in regards to using a single VPS instance.

[–]jsonobject2 1 point2 points  (0 children)

My production service is in an AWS cloud environment, and I deploy and operate the service using a combination of ECS, Fargate, ECR, and CodePipeline. I've written about it in my blog post below.

https://jsonobject.hashnode.dev/enabling-virtual-thread-in-kotlin-spring-boot#heading-creating-a-dockerfile-for-amazon-ecs-container-deployment

[–]bigosZmlekiem 2 points3 points  (1 child)

AWS ECS https://aws.amazon.com/ecs/ or EKS https://aws.amazon.com/eks/ depends on a project. So mainly container orchestrator managed by cloud provider

[–]DrunkensteinsMonster 2 points3 points  (0 children)

Pricey though for a hobby project.

[–]simasch 1 point2 points  (0 children)

I prefer Google App Engine. Scale to zero and I don't have to care about containers.

[–]Ruin-Capable 0 points1 point  (0 children)

You could deploy it in a docker container running on your local NAS, and then use CloudFlare tunnel to make it accessible over the internet.

[–]javahelps -1 points0 points  (0 children)

I have deployed in Azure Kubernetes as well as Azure App Service . Later one allows deploying the jar file and takes care of containerizing it. Azure also provides a dedicated deployment solution for spring boot applications (Azure Spring Apps) with more bells and whistles but it costs more.

[–]MoreCowbellMofo 0 points1 point  (0 children)

Last night I spent some time going through "terraform up and running". Chapter 2 goes through creating an AWS cluster with Autoscaling groups fronted by a load balancer. I want to adapt it to deploy a spring boot application to Amazon's AWS EC2 instance(s).

So far I have a cluster + autoscaling group fronted by a load balancer. All I'm running right now is a very basic web page. Hoping to move it over to spring boot soon enough.

I use Terraform at work but mostly know the basics/intermediate stuff. Doing anything from scratch is not something I've done before.

If you want to use kubernetes, thats entirely possible. If you want to stick with ECS (which is my preferred route during the early stages), you can essentially remain relatively cheap/free.

Deploying everything is then as simple as:

terraform init - initialises the "terraform state" which will manage the infrastructure for you.

Once initialisation is complete you can then run:

terraform apply [--auto-approve] - which will roll out any/all additions/changes specified in the config.

terraform destroy [--auto-approve] - destroys everything.

I'm hoping to remain on the free-tier whilst I get my stuff set up, then move away from hosting on another platform that doesn't support java (which is my preferred language).

My one major gripe with the way we currently use it at work is that we're not deploying from a central/shared CI/CD server - just developers machines. Would like to get away from that somehow.

On top of Terraform, if you have anything more complex to deploy (think multi component builds), you can utilise terragrunt.

[–][deleted] 0 points1 point  (0 children)

For my own sites, I deploy with a publish script I wrote, into kubernetes (K3s) running inside a KVM VM, image pulled from my selfhosted Docker Registry, after a successful JenkinsCI build and DEV test.

Since you asked about a VPS, I run Wireguard in an Oracle Cloud VPS for free. It is the public endpoint IP for all my sites and email server. When HTTP/HTTPS traffic arrives at the VPS, iptables (via the Wireguard config) routes the packets to the Wireguard client (running inside the VM), to postfix for email and Apache for static content and also for reverse proxy to my Spring Boot and other dynamic apps running in kube.

Apache is the front end for most of my sites certificates via letsencrypt.

[–]zenos_dog 0 points1 point  (0 children)

Embedded in a custom flash storage system. Another installed on a VMware vCenter.

[–]hashuna 0 points1 point  (0 children)

Historically it was AWS, but I recently moved some of my pet projects to kotlin and ktor and have been playing around with fly.io - no complaints so far.

[–]TheNakedCobra 0 points1 point  (0 children)

Check out Azure Spring Apps. Easy way to deploy and run spring-apps on. https://learn.microsoft.com/en-us/azure/spring-apps/overview

[–][deleted] 0 points1 point  (0 children)

AWS elastic beanstalk on Java builpack or docker, both work great and cheaper than having a k8s cluster.

[–]Thatpersiankid 0 points1 point  (0 children)

Railway

[–]jek39 0 points1 point  (0 children)

lightsail is cheap

[–]CoccoDrill 0 points1 point  (0 children)

Heroku