-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next' into chore/browser-launch-delay
- Loading branch information
Showing
58 changed files
with
7,762 additions
and
3,940 deletions.
There are no files selected for viewing
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
title: Tutorial | ||
order: 3 | ||
section-nav: hidden | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
Oops, something went wrong.