Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ class Config {

this.useClustering = this.useLiferay && this.clusterNodes > 0

this.useClamAV = this.services.contains("clamav")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is not actually used for anything, let's just remove it.


if (this.services.contains("db2")) {
this.databaseType = "db2"
this.useDatabase = true
Expand Down Expand Up @@ -321,6 +323,7 @@ class Config {
public String namespace = null
public String product = null
public List<String> services = new ArrayList<String>()
public boolean useClamAV = false
public boolean useClustering = false
public boolean useDatabase = false
public boolean useDatabaseDB2 = false
Expand Down
7 changes: 7 additions & 0 deletions compose-recipes/clamav/liferay.clamav.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
liferay:
depends_on:
clamav:
condition: service_healthy
environment:
- LIFERAY_DL_PERIOD_STORE_PERIOD_ANTIVIRUS_PERIOD_ENABLED=true
11 changes: 11 additions & 0 deletions compose-recipes/clamav/service.clamav.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
clamav:
container_name: ${NAMESPACE}-clamav
healthcheck:
interval: 30s
retries: 5
test: echo 'PING' | nc -w 5 localhost ${CLAMAV_PORT}
timeout: 10s
image: clamav/clamav:${CLAMAV_VERSION}
ports:
- ${CLAMAV_PORT}:3310
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hostname="clamav"
port=I"3310"
Copy link
Member Author

@anthony-chu anthony-chu Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm wondering if it would be helpful to make the value of the port dynamically configured based on CLAMAV_PORT from ports.env. if we do, it seems like the ports.env file is only parsed in build.gradle, so the docker-liferay-bundle.gradle file wouldn't have access to it (at least, not that i know of; there might be a way). the only thought i had would be to parse it again as part of a task to configure this config file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anthony-chu you should not need to configure this - it's all "in the box" (in the Docker network) and should not relate to the exposed host ports at all. See what we do for the elasticsearch service - it's a hard-coded port.

But to answer the more general question - you could parameterize this and do a string-replace during the Gradle copy operation that moves this to the Docker staging dir. See the Gradle docs and this example from Composer for ways to do it whenever it may be needed in the future.

timeout=I"120000"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anthony-chu if we have a conf file here, it will deploy no matter what, even if the antivirus is not enabled. This is why we instead put the configs as environment variables in liferay.{serviceName}.yaml files. See the liferay.elasticsearch.yaml file for an example.

1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ lr.docker.environment.compose.files=
# Enable each service or "service" that you would like to include in your
# environment. If the value is "true" or "1", the service is enabled. Any other
# value (or a blank value) is ignored and disables the service.
lr.docker.environment.service.enabled[clamav]=false
lr.docker.environment.service.enabled[db2]=false
lr.docker.environment.service.enabled[elasticsearch]=false
lr.docker.environment.service.enabled[liferay]=true
Expand Down
2 changes: 2 additions & 0 deletions ports.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ LIFERAY_GOGO_SHELL_PORT=11311-11319
LIFERAY_DEBUG_PORT=8000-8009
LIFERAY_YOURKIT_PORT=10001-10010

CLAMAV_PORT=3310

DATABASE_PORT=54321-54330

ELASTICSEARCH_HTTP_PORT=9200-9209
Expand Down
1 change: 1 addition & 0 deletions versions.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CLAMAV_VERSION=1.0.9
DB2_VERSION=11.5.9.0
MARIADB_VERSION=10.6.22-jammy
MYSQL_VERSION=8.4.5-oracle
Expand Down