Skip to content

Commit

Permalink
Merge branch 'next' into chore/browser-launch-delay
Browse files Browse the repository at this point in the history
  • Loading branch information
russelljtdyer authored May 1, 2024
2 parents 6c77273 + 9eca8d8 commit 13052df
Show file tree
Hide file tree
Showing 58 changed files with 7,762 additions and 3,940 deletions.
Binary file removed articles/flow/_images/completed-app.gif
Binary file not shown.
101 changes: 0 additions & 101 deletions articles/flow/quick-start.adoc

This file was deleted.

1 change: 1 addition & 0 deletions articles/flow/tutorial/index.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
title: Tutorial
order: 3
section-nav: hidden
---
73 changes: 73 additions & 0 deletions articles/getting-started/tutorial/deployment.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: Deploy to Production
description: Learn how to deploy your Vaadin application to the cloud
order: 60
---


= [since:com.vaadin:vaadin@V24.4]#Deploy to Production#

You are now ready to deploy your application. In this tutorial, you will be deploying to https://fly.io[Fly.io], as they have a cheap hobby plan that includes a free trial. However, even if you are only going to use the free trial, you are required to enter a valid credit card number.

You need to have https://docker.com[Docker] installed and running on your machine before you can proceed with this step.


== Prepare Fly.io

Before you can deploy to Fly.io, you need to install a command-line utility and create an account. Follow the instructions https://fly.io/docs/hands-on/[here].


== Create a Docker image

You are now going to turn your application into a Docker image. The easiest way to do this is to use the Spring Boot maven plugin, which in turn uses https://buildpacks.io[buildpacks] to make an image from your application.

Run this command in the root directory of your project to start the build:

[source,terminal]
----
./mvnw clean spring-boot:build-image -Pproduction
----

The build will take some time to complete, especially the first time you run it. Once it has completed, verify that the image has been created by running this command:

[source,terminal]
----
docker image ls -a
----

You should see a line for the image you just created: `unified-chat-tutorial-flow 1.0-SNAPSHOT 438ec79fe5a3` (the hash may be different on your machine).

Next, try out the new Docker image by running this command:

[source,terminal]
----
docker run -p8080:8080 unified-chat-tutorial:1.0-SNAPSHOT
----

You should now be able to access the application at http://localhost:8080. Once you have verified that the application is running, stop the container by pressing Ctrl-C.


== Deploy to Fly.io

You are now ready to deploy the application to Fly.io. Start the deployment by running this command:

[source,terminal]
----
fly launch --image unified-chat-tutorial:1.0-SNAPSHOT --local-only
----

The tool will suggest settings for you and ask if you want to make any changes to them. Select the default answer (no) by pressing Enter.

It will then ask if you want to create a [filename]`.dockerignore` file. Again, select the default answer (no) by pressing Enter. The deployment process should now begin.

Once the deployment is finished, the tool will give you the URL at which the application can be visited. Try it out!

Remember to delete the app when you no longer need it to avoid unneccessary charges on your credit card:

[source,terminal]
----
fly apps destroy unified-chat-tutorial
----

You can also delete the app using the Fly.io dashboard.

Loading

0 comments on commit 13052df

Please sign in to comment.