<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Bishal</title>
    <description>The latest articles on Forem by Bishal (@merkasin).</description>
    <link>https://forem.com/merkasin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1055467%2F8dfe846b-10b6-4b53-a188-7fbc41d6222a.jpg</url>
      <title>Forem: Bishal</title>
      <link>https://forem.com/merkasin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/merkasin"/>
    <language>en</language>
    <item>
      <title>Learning to deploy Spring boot Web Application to On Render(free tier)</title>
      <dc:creator>Bishal</dc:creator>
      <pubDate>Thu, 30 Mar 2023 11:35:24 +0000</pubDate>
      <link>https://forem.com/merkasin/learning-to-deploy-spring-boot-web-application-to-on-renderfree-tier-478m</link>
      <guid>https://forem.com/merkasin/learning-to-deploy-spring-boot-web-application-to-on-renderfree-tier-478m</guid>
      <description>&lt;p&gt;After you make a spring boot web app using spring data jpa, thymeleaf, the next challenge comes when you want to deploy that app to show your colleagues or college friends.&lt;/p&gt;

&lt;p&gt;There are very few free hosting services that allow you to deploy web apps.&lt;/p&gt;

&lt;p&gt;I found one with the name of On render, which gave a free plan to host web services.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd1cjku9ixdt8btzgpqw8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd1cjku9ixdt8btzgpqw8.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even after I found the platform, there was still a challenge, how do I deploy the spring boot app? They have very good services for nodejs and others.&lt;/p&gt;

&lt;p&gt;The only solution to that was to deploy using Docker.&lt;/p&gt;

&lt;p&gt;For that, I had to make a docker file using the name "Dockerfile" without any extension, in the root directory of the project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwzmun2brzmmnoeyfqpkp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwzmun2brzmmnoeyfqpkp.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finding the maven version that was required for the OpenJDK 19 was a headache.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwtwky56qm2f3ztf0brik.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwtwky56qm2f3ztf0brik.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;after I set the version in the docker file, compile version was not matching with it so I had to set it manually in the pom.xml, which did the trick.&lt;/p&gt;

&lt;p&gt;But after that it was easy, just needed to set the command to make a maven clean build on the docker container, expose the port, and set the entry point.&lt;/p&gt;

&lt;p&gt;Then you just need to push it to git repo and connect it in onrender by creating a new web service.&lt;/p&gt;

&lt;p&gt;After completing the build in the server you can run your web app on the given domain from on render.&lt;/p&gt;

&lt;p&gt;You can check(might need some time (2-3min) to open as it is free hosting)&lt;/p&gt;

&lt;p&gt;my weather app --&amp;gt;&lt;a href="https://weatherapp-g3yu.onrender.com" rel="noopener noreferrer"&gt;https://weatherapp-g3yu.onrender.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;my todo app --&amp;gt;&lt;a href="https://todoapp-shwf.onrender.com" rel="noopener noreferrer"&gt;https://todoapp-shwf.onrender.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you need help you can get in touch I can help you out&lt;/p&gt;

&lt;p&gt;&lt;a href="mailto:merkasin272@gmail.com"&gt;merkasin272@gmail.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>deploywebapp</category>
      <category>docker</category>
      <category>java</category>
      <category>springboot</category>
    </item>
  </channel>
</rss>
