This commit is contained in:
@@ -16,6 +16,15 @@ WORKDIR /home/luser
|
|||||||
ADD logback.xml .
|
ADD logback.xml .
|
||||||
ENTRYPOINT ["java", "-Dlogback.configurationFile=logback.xml", "-XX:MaxRAMPercentage=70", "-XX:GCTimeRatio=24", "-XX:+UseZGC", "-XX:+ZGenerational", "-jar", "/home/luser/rbcs.jar"]
|
ENTRYPOINT ["java", "-Dlogback.configurationFile=logback.xml", "-XX:MaxRAMPercentage=70", "-XX:GCTimeRatio=24", "-XX:+UseZGC", "-XX:+ZGenerational", "-jar", "/home/luser/rbcs.jar"]
|
||||||
|
|
||||||
|
FROM base-release AS release-redis
|
||||||
|
ADD --chown=luser:luser rbcs-cli-envelope-*.jar rbcs.jar
|
||||||
|
RUN mkdir plugins
|
||||||
|
WORKDIR /home/luser/plugins
|
||||||
|
RUN --mount=type=bind,source=.,target=/build/distributions tar -xf /build/distributions/rbcs-server-redis*.tar
|
||||||
|
WORKDIR /home/luser
|
||||||
|
ADD logback.xml .
|
||||||
|
ENTRYPOINT ["java", "-Dlogback.configurationFile=logback.xml", "-XX:MaxRAMPercentage=70", "-XX:GCTimeRatio=24", "-XX:+UseZGC", "-XX:+ZGenerational", "-jar", "/home/luser/rbcs.jar"]
|
||||||
|
|
||||||
FROM busybox:musl AS base-native
|
FROM busybox:musl AS base-native
|
||||||
RUN mkdir -p /var/lib/rbcs /etc/rbcs
|
RUN mkdir -p /var/lib/rbcs /etc/rbcs
|
||||||
RUN adduser -D -u 1000 rbcs -h /var/lib/rbcs
|
RUN adduser -D -u 1000 rbcs -h /var/lib/rbcs
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ configurations {
|
|||||||
dependencies {
|
dependencies {
|
||||||
configureNativeImageImplementation project
|
configureNativeImageImplementation project
|
||||||
configureNativeImageImplementation project(':rbcs-server-memcache')
|
configureNativeImageImplementation project(':rbcs-server-memcache')
|
||||||
|
configureNativeImageImplementation project(':rbcs-server-redis')
|
||||||
|
|
||||||
implementation catalog.jwo
|
implementation catalog.jwo
|
||||||
implementation catalog.slf4j.api
|
implementation catalog.slf4j.api
|
||||||
@@ -62,6 +63,7 @@ dependencies {
|
|||||||
runtimeOnly catalog.logback.classic
|
runtimeOnly catalog.logback.classic
|
||||||
// runtimeOnly catalog.slf4j.simple
|
// runtimeOnly catalog.slf4j.simple
|
||||||
nativeImage project(':rbcs-server-memcache')
|
nativeImage project(':rbcs-server-memcache')
|
||||||
|
nativeImage project(':rbcs-server-redis')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,6 +140,7 @@ Provider<JlinkTask> jlinkTaskProvider = tasks.named(JlinkPlugin.JLINK_TASK_NAME,
|
|||||||
)
|
)
|
||||||
additionalModules = [
|
additionalModules = [
|
||||||
'net.woggioni.rbcs.server.memcache',
|
'net.woggioni.rbcs.server.memcache',
|
||||||
|
'net.woggioni.rbcs.server.redis',
|
||||||
'ch.qos.logback.classic',
|
'ch.qos.logback.classic',
|
||||||
'jdk.crypto.ec'
|
'jdk.crypto.ec'
|
||||||
]
|
]
|
||||||
|
|||||||
53
rbcs-cli/conf/rbcs-server-redis.xml
Normal file
53
rbcs-cli/conf/rbcs-server-redis.xml
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<rbcs:server xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns:rbcs="urn:net.woggioni.rbcs.server"
|
||||||
|
xmlns:rbcs-redis="urn:net.woggioni.rbcs.server.redis"
|
||||||
|
xs:schemaLocation="urn:net.woggioni.rbcs.server.redis jpms://net.woggioni.rbcs.server.redis/net/woggioni/rbcs/server/redis/schema/rbcs-redis.xsd urn:net.woggioni.rbcs.server.memcache jpms://net.woggioni.rbcs.server.memcache/net/woggioni/rbcs/server/memcache/schema/rbcs-memcache.xsd urn:net.woggioni.rbcs.server jpms://net.woggioni.rbcs.server/net/woggioni/rbcs/server/schema/rbcs-server.xsd"
|
||||||
|
>
|
||||||
|
<bind host="127.0.0.1" port="8080" incoming-connections-backlog-size="1024"/>
|
||||||
|
<connection
|
||||||
|
max-request-size="67108864"
|
||||||
|
idle-timeout="PT10S"
|
||||||
|
read-idle-timeout="PT20S"
|
||||||
|
write-idle-timeout="PT20S"/>
|
||||||
|
<event-executor use-virtual-threads="true"/>
|
||||||
|
<cache xs:type="rbcs-redis:redisCacheType" max-age="P7D" digest="MD5">
|
||||||
|
<server host="127.0.0.1" port="6379" max-connections="256"/>
|
||||||
|
</cache>
|
||||||
|
<!--cache xs:type="rbcs:inMemoryCacheType" max-age="P7D" enable-compression="false" max-size="0x10000000" /-->
|
||||||
|
<!--cache xs:type="rbcs:fileSystemCacheType" max-age="P7D" enable-compression="false" /-->
|
||||||
|
<authorization>
|
||||||
|
<users>
|
||||||
|
<user name="woggioni" password="II+qeNLft2pZ/JVNo9F7jpjM/BqEcfsJW27NZ6dPVs8tAwHbxrJppKYsbL7J/SMl">
|
||||||
|
<quota calls="100" period="PT1S"/>
|
||||||
|
</user>
|
||||||
|
<user name="gitea" password="v6T9+q6/VNpvLknji3ixPiyz2YZCQMXj2FN7hvzbfc2Ig+IzAHO0iiBCH9oWuBDq"/>
|
||||||
|
<anonymous>
|
||||||
|
<quota calls="10" period="PT60S" initial-available-calls="10" max-available-calls="10"/>
|
||||||
|
</anonymous>
|
||||||
|
</users>
|
||||||
|
<groups>
|
||||||
|
<group name="readers">
|
||||||
|
<users>
|
||||||
|
<anonymous/>
|
||||||
|
</users>
|
||||||
|
<roles>
|
||||||
|
<reader/>
|
||||||
|
</roles>
|
||||||
|
</group>
|
||||||
|
<group name="writers">
|
||||||
|
<users>
|
||||||
|
<user ref="woggioni"/>
|
||||||
|
<user ref="gitea"/>
|
||||||
|
</users>
|
||||||
|
<roles>
|
||||||
|
<reader/>
|
||||||
|
<writer/>
|
||||||
|
</roles>
|
||||||
|
</group>
|
||||||
|
</groups>
|
||||||
|
</authorization>
|
||||||
|
<authentication>
|
||||||
|
<none/>
|
||||||
|
</authentication>
|
||||||
|
</rbcs:server>
|
||||||
@@ -27,16 +27,27 @@ import net.woggioni.rbcs.server.cache.FileSystemCacheConfiguration
|
|||||||
import net.woggioni.rbcs.server.cache.InMemoryCacheConfiguration
|
import net.woggioni.rbcs.server.cache.InMemoryCacheConfiguration
|
||||||
import net.woggioni.rbcs.server.configuration.Parser
|
import net.woggioni.rbcs.server.configuration.Parser
|
||||||
import net.woggioni.rbcs.server.memcache.MemcacheCacheConfiguration
|
import net.woggioni.rbcs.server.memcache.MemcacheCacheConfiguration
|
||||||
|
import net.woggioni.rbcs.server.redis.RedisCacheConfiguration
|
||||||
|
|
||||||
object GraalNativeImageConfiguration {
|
object GraalNativeImageConfiguration {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun main(vararg args : String) {
|
fun main(vararg args : String) {
|
||||||
|
|
||||||
|
let {
|
||||||
val serverURL = URI.create("file:conf/rbcs-server.xml").toURL()
|
val serverURL = URI.create("file:conf/rbcs-server.xml").toURL()
|
||||||
val serverDoc = serverURL.openStream().use {
|
val serverDoc = serverURL.openStream().use {
|
||||||
Xml.parseXml(serverURL, it)
|
Xml.parseXml(serverURL, it)
|
||||||
}
|
}
|
||||||
Parser.parse(serverDoc)
|
Parser.parse(serverDoc)
|
||||||
|
}
|
||||||
|
|
||||||
|
let {
|
||||||
|
val serverURL = URI.create("file:conf/rbcs-server-redis.xml").toURL()
|
||||||
|
val serverDoc = serverURL.openStream().use {
|
||||||
|
Xml.parseXml(serverURL, it)
|
||||||
|
}
|
||||||
|
Parser.parse(serverDoc)
|
||||||
|
}
|
||||||
|
|
||||||
val url = URI.create("file:conf/rbcs-client.xml").toURL()
|
val url = URI.create("file:conf/rbcs-client.xml").toURL()
|
||||||
val clientDoc = url.openStream().use {
|
val clientDoc = url.openStream().use {
|
||||||
@@ -90,6 +101,18 @@ object GraalNativeImageConfiguration {
|
|||||||
"MD5",
|
"MD5",
|
||||||
null,
|
null,
|
||||||
1,
|
1,
|
||||||
|
),
|
||||||
|
RedisCacheConfiguration(
|
||||||
|
listOf(RedisCacheConfiguration.Server(
|
||||||
|
HostAndPort("127.0.0.1", 6379),
|
||||||
|
1000,
|
||||||
|
4)
|
||||||
|
),
|
||||||
|
Duration.ofSeconds(60),
|
||||||
|
"someCustomPrefix",
|
||||||
|
"MD5",
|
||||||
|
null,
|
||||||
|
1,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user