Configuration is done through image parameters.
First one is the port (default to 8080
) and second one is the doc base (where static website is located - default to /opt/yupiik/www
).
Port can be overridden with PORT
environment variable and doc base with DOC_BASE
one.
By default, the server will cache any static resource in memory, if you want to control the cache, tune the following environment variables:
-
CACHE_TTL
: how long to keep in memory the cached data, -
CACHE_MAX_SIZE
: max size in kb of the cache, -
CACHE_MAX_OBJECT_SIZE
: max size in kb of each entry in the cache (/20
compared toCACHE_MAX_SIZE
is recommended).
For performances, you can also tune the Tomcat protocol configuration:
-
TOMCAT_ACCEPT_COUNT
backlog size, -
TOMCAT_PROCESSOR_CACHE
process cache size (recommended to be ~ the thread count), -
TOMCAT_MAX_THREADS
number of processor threads.
docker run --rm -p 8080:8080 -v /home/user/local/www:/opt/my-website/www ossyupiik/simple-http-server:$IMAGE_VERSION 8080 /opt/my-website/www
Then hit http://localhost:8080.
Tip
|
depending on your docker version you can need to set --security-opt seccomp=unconfined option.
|
The java release is a standard maven release (mvn release:prepare release:perform
).
Note
|
since the project uses Java 21, you must close/release the staging repository on OSS repository manually (we don’t use the sonatype plugin). |
Then you can create and push the docker image following this process:
-
Clone the tag you created (or keep the build folder if you still have it),
-
Run
mvn package arthur:native-image arthur:image -Dimage.registry=docker.io/
(note: you can change registry if needed).