A simple provisioning template to run a PostgreSQL-backed Java EE application via Wildfly. Static clients can be served via nginx.
Provisioning of the following components is prepared and will happen in the listed order:
- Updated Ubuntu 16.4 LTS (via bento/ubuntu-16.10)
- Oracle Java 8 (you're silently accepting the Java license using this template!)
- PostgreSQL 9.5
- Wildfly 10.1.0
- nginx
- Your app...
Have a look at variables.sh to edit the provided default variables to your liking. You can add more values if needed.
The VM is bound to an host-only network. The IP is static and is bound to 192.168.100.100. The following components listen to '*' for ease of use.
| port | description |
|---|---|
| 80 | static web content served by nginx |
| 5432 | PostgreSQL CLI interface |
| 8080 | Wildfly http interface |
| 9990 | Wildfly management interface |
| file | description |
|---|---|
app-install.sh |
Takes care of linking the content as needed, e.g. by adding a PostgreSQL-datasource to the Wildfly server, syncing static web content to the web servers root directory and deploying all globed WAR-files. |
java-install.sh |
Installs Oracle Java 8 as the default JVM. |
nginx-install.sh |
Installs nginx as provided by the Ubuntu software repositories. |
postgresql-install.sh |
Installs PostgreSQL as provided by the Ubuntu software repositories. |
variables.sh |
Exports needed variables to execute the install scripts. |
wildfly-install.sh |
Downloads and installs Wildfly 10. |
wildfly.cli |
jboss-cli.sh-script that is used to add a PostgreSQL XA-datasource programmatically. ENV variables are interpolated before executing the script with the CLI. |
Add your content here so it will be made available at provisioning time:
| folder | description |
|---|---|
| sites | enabled-sites configurations as used by nginx. A common use case would be to define a proxy location pointing to your Java application. |
| sql | Add an import.sql script that will be executed after initializing the application server and deploying all apps. |
| war | Self contained WAR-files (*.war) that will be deployed to the Wildfly server at provisioning time. |
| www | Static web content as served by nginx. |
After adding your content and adjusting the settings to your needs run the VM via Vagrant.
$ vagrant up