-
Notifications
You must be signed in to change notification settings - Fork 23
234 Embedded deployment #293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
743571f
d8dc5d4
654bc51
1cf3725
8095305
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| FROM amazoncorretto:21-alpine3.20 | ||
|
|
||
| ENV ELDA_PORT=8080 | ||
| EXPOSE 8080 | ||
|
|
||
| ENV ELDA_WEBAPP_PATH=/etc/elda | ||
|
|
||
| COPY target/elda-standalone-jar-with-dependencies.jar app.jar | ||
|
|
||
| CMD java -jar /app.jar | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # ELDA Standalone Application | ||
|
|
||
| This module contains a standalone ELDA application which runs an embedded Tomcat server. | ||
|
|
||
| To build: | ||
| * `mvn clean package` | ||
|
|
||
| To run: | ||
| * `java -jar target/elda-standalone-jar-with-dependencies.jar` | ||
|
|
||
| ### Sample Web Server | ||
|
|
||
| By default, the application loads a web server configuration, including ELDA API specs, | ||
| from the `src/main/webapp` directory, which contains a small sample API. | ||
| When running with the sample API, check http://localhost:8080/standalone/again/games.ttl to confirm that the | ||
| server is running correctly. | ||
|
|
||
| Note that the sample API does not support HTML rendering. | ||
|
|
||
| ### Configuring the Web Server | ||
|
|
||
| To run the application with your own web server configuration, | ||
| set the `ELDA_WEBAPP_PATH` environment variable to the path to your web app directory. | ||
| This directory **must contain** a `web.xml` file which configures the web server. | ||
|
|
||
| It must also contain the ELDA API specs and static resources (velocity templates, scripts, stylesheets etc.) | ||
| you want to serve. | ||
|
|
||
| To run the web server with a context path, set the `ELDA_CONTEXT_PATH` environment variable to the context path. | ||
| The default context path is `/standalone`. | ||
| To run without a context path set the environment variable to `/`. | ||
|
|
||
| To run the web server with an alternate port (the default is 8080), set the `ELDA_PORT` environment variable to the port number. | ||
|
Comment on lines
+22
to
+33
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor stylistic point but a table of configuration variables with meaning and default is easier to read and check off against than a block of prose. |
||
|
|
||
| ### Docker Image | ||
|
|
||
| To build the standalone application as a Docker image, run: | ||
| * `docker build -t elda/standalone:test .` | ||
|
|
||
| The image does not contain any web server configuration or ELDA API specs, | ||
| hence these must be mounted to a running container as a volume. | ||
| The default web app directory is `/etc/elda`. | ||
|
|
||
| To run the image in a Docker container, run: | ||
| * `docker run -p 8080:8080 -v {host webapp dir}:{container webapp dir} -e ELDA_WEBAPP_PATH={container webapp dir} elda/standalone:test` | ||
|
|
||
| For example, to run with the sample web server: | ||
| * `docker run -p 8080:8080 -v ./src/main/webapp:/etc/elda -e ELDA_WEBAPP_PATH=/etc/elda elda/standalone:test` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also a good idea to set a default elda_webapp_path and document that, as the internally set default is not really appropriate in the Docker environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.