|
1 |
| -# VaadinDockerBuild |
| 1 | +# Vaadin Docker Image |
2 | 2 |
|
3 |
| -This is an example project that can be used as a starting point to create your own Vaadin application with Spring Boot. |
4 |
| -It contains all the necessary configuration and some placeholder files to get you started. |
| 3 | +Build docker image for Vaadin application. |
5 | 4 |
|
6 |
| -The project is a standard Maven project, so you can import it to your IDE of choice. [Read more how to set up a development environment](https://vaadin.com/docs/v14/flow/installing/installing-overview.html) for Vaadin projects (Windows, Linux, macOS). |
| 5 | +## Build Image |
| 6 | +To build image run this command (__change the tag name & version with your preferred tag name & version__). |
7 | 7 |
|
8 |
| -This project was created from https://start.vaadin.com. |
| 8 | +`$ docker build . -t myorganization/myimage:1.0.0` |
9 | 9 |
|
10 |
| -## Running and debugging the application |
| 10 | +## Running Container from Image |
11 | 11 |
|
12 |
| -### Running the application from the command line. |
13 |
| -To run from the command line, use `mvn` and open http://localhost:8080 in your browser. |
| 12 | +To create a container from the image, run this command (__change the tag name & version with your preferred tag name & version__). |
14 | 13 |
|
15 |
| -### Running and debugging the application in Intellij IDEA |
16 |
| -- Locate the Application.java class in the Project view. It is in the src folder, under the main package's root. |
17 |
| -- Right-click on the Application class |
18 |
| -- Select "Debug 'Application.main()'" from the list |
| 14 | +`$ docker run -d -p 8080:8080 --name vaadin-app myorganization/myimage:1.0.0` |
19 | 15 |
|
20 |
| -After the application has started, you can view it at http://localhost:8080/ in your browser. |
21 |
| -You can now also attach breakpoints in code for debugging purposes, by clicking next to a line number in any source file. |
| 16 | +Then you can access the app from the browser with this url: `http://127.0.0.1:8080` |
22 | 17 |
|
23 |
| -### Running and debugging the application in Eclipse |
24 |
| -- Locate the Application.java class in the Package Explorer. It is in `src/main/java`, under the main package. |
25 |
| -- Right-click on the file and select `Debug As` --> `Java Application`. |
| 18 | +## Dockerhub image |
26 | 19 |
|
27 |
| -Do not worry if the debugger breaks at a `SilentExitException`. This is a Spring Boot feature and happens on every startup. |
28 |
| - |
29 |
| -After the application has started, you can view it at http://localhost:8080/ in your browser. |
30 |
| -You can now also attach breakpoints in code for debugging purposes, by clicking next to a line number in any source file. |
31 |
| -## Project structure |
32 |
| - |
33 |
| -- `MainView.java` in `src/main/java` contains the navigation setup. It uses [App Layout](https://vaadin.com/components/vaadin-app-layout). |
34 |
| -- `views` package in `src/main/java` contains the server-side Java views of your application. |
35 |
| -- `views` folder in `frontend/` contains the client-side JavaScript views of your application. |
36 |
| - |
37 |
| -## What next? |
38 |
| - |
39 |
| -[vaadin.com](https://vaadin.com) has lots of material to help you get you started: |
40 |
| - |
41 |
| -- Follow the tutorials in [vaadin.com/tutorials](https://vaadin.com/tutorials). Especially [vaadin.com/tutorials/getting-started-with-flow](https://vaadin.com/tutorials/getting-started-with-flow) is good for getting a grasp of the basic Vaadin concepts. |
42 |
| -- Read the documentation in [vaadin.com/docs](https://vaadin.com/docs). |
43 |
| -- For a bigger Vaadin application example, check out the Full Stack App starter from [vaadin.com/start](https://vaadin.com/start). |
44 |
| - |
45 |
| -## Deploying using Docker |
46 |
| - |
47 |
| -To build the Dockerized version of the project, run |
48 |
| - |
49 |
| -``` |
50 |
| -docker build . -t myapp:latest |
51 |
| -``` |
52 |
| - |
53 |
| -Once the Docker image is correctly built, you can test it locally using |
54 |
| - |
55 |
| -``` |
56 |
| -docker run -p 8080:8080 myapp:latest |
57 |
| -``` |
| 20 | +This repository is proven by running build in Dockerhub, you can see the result [here](https://hub.docker.com/r/namikazebadri/vaadin-app). |
0 commit comments