dockerizing_4dscience/compose.yml

165 lines
6.0 KiB
YAML
Raw Normal View History

2024-12-05 13:52:13 +01:00
services:
cassandra1:
extends:
file: ./cassandra/compose.yml
service: cassandra1
container_name: cassandra1
ports:
- "9042:9042" # Cassandra default port for CQL
networks:
- cassandra-net
- app-network
cassandra2:
extends:
file: ./cassandra/compose.yml
service: cassandra2
container_name: cassandra2
ports:
- "9043:9042" # Cassandra instance 2 CQL port
networks:
- cassandra-net
- app-network
cassandra3:
extends:
file: ./cassandra/compose.yml
service: cassandra3
container_name: cassandra3
ports:
- "9044:9042" # Cassandra instance 3 CQL port
networks:
- cassandra-net
- app-network
socialservice:
extends:
file: ./socialservice/compose.yml
service: socialservice
container_name: socialservice
# depends_on:
# cassandra1:
# condition: service_healthy
# cassandra2:
# condition: service_healthy
# cassandra3:
# condition: service_healthy
ports:
- "5002:8000" # Social service debug port for Tomcat
- "8081:8081" # Social service API port
networks:
- app-network
postgres:
image: postgres:16
container_name: postgres
environment:
POSTGRES_DB: liferay_db
POSTGRES_USER: infra_bundle_dev
POSTGRES_PASSWORD: pass_db
volumes:
- ./postgres/pgdata:/var/lib/postgresql/data
- ./postgres/init-user-db.sh:/docker-entrypoint-initdb.d/01-init-user-db.sh
- ./postgres/backup.sql:/docker-entrypoint-initdb.d/02-init.sql
- ./postgres/patches.sql:/docker-entrypoint-initdb.d/03-patches.sql
- ./postgres/postgresql.conf:/etc/postgresql/postgresql.conf
- ./logs/postgres:/var/log/postgresql
ports:
- "5432:5432" # Postgres default port
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
command: ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]
networks:
- app-network
keycloak:
extends:
file: keycloak/compose.yaml
service: keycloak
container_name: keycloak
ports:
- "8080:8080" # Keycloak public access port
- "9990:9990" # Keycloak management port
extra_hosts:
- "keycloak:127.0.0.1" # Map the keycloak hostname to localhost
volumes:
- ./configurations/keycloak/realms/${REALM_FILE}:/opt/keycloak/data/import/realm.json
- ./logs/keycloak:/opt/keycloak/logs
environment:
- KC_LOG=console,file # Set the log directory environment variable
- KC_LOG_FILE=/opt/keycloak/logs/logs.log
- KC_LOG_LEVEL=${KC_LOG_LEVEL}
- KC_HEALTH_ENABLED=true
- KC_METRICS_ENABLED=false
networks:
- app-network
liferay:
2024-12-06 10:37:39 +01:00
extends:
file: ./liferay/compose.yaml
service: liferay
2024-12-05 13:52:13 +01:00
container_name: liferay
# ports:
# - "${LIFERAY_PORT}:9090" # Liferay exposed on HTTP port 80
# - "${LIFERAY_DEBUG_PORT}:5001" # Liferay debug port
volumes:
- ${LIFERAY_MNT_LOGS}/Portal-Bundle:${LIFERAY_PORTAL_BUNDLE_PATH}/logs
- ${LIFERAY_MNT_LOGS}/tomcat:${LIFERAY_CASSANDRA_HOME}/logs
# - ./liferay/config/portal-ext-nok.properties:${LIFERAY_CASSANDRA_HOME}/webapps/ROOT/WEB-INF/classes/portal-ext.properties
- ${LIFERAY_MNT_CONFIG}/portal-ext.properties:${LIFERAY_CASSANDRA_HOME}/webapps/ROOT/WEB-INF/classes/portal-ext.properties
- ${LIFERAY_MNT_CONFIG}/portal-developer.properties:${LIFERAY_CASSANDRA_HOME}/webapps/ROOT/WEB-INF/classes/portal-developer.properties
- ${LIFERAY_MNT_CONFIG}/log4j.properties:${LIFERAY_CASSANDRA_HOME}/webapps/ROOT/WEB-INF/classes/log4j.properties
- ${LIFERAY_MNT_CONFIG}/portal-logback.xml:${LIFERAY_CASSANDRA_HOME}/webapps/ROOT/WEB-INF/classes/portal-logback.xml
- ${LIFERAY_MNT_CONFIG}/log4j.properties:${LIFERAY_CASSANDRA_HOME}/log4j.properties
- ${LIFERAY_MNT_CONFIG}/logging.properties:${LIFERAY_CASSANDRA_HOME}/logging.properties
- ${LIFERAY_MNT_CONFIG}/portal-setup-wizard.properties:${LIFERAY_PORTAL_BUNDLE_PATH}/portal-setup-wizard.properties
- ${LIFERAY_MNT_WEBAPPS}:${LIFERAY_CASSANDRA_HOME}/webapps
2024-12-06 10:37:39 +01:00
- ${LIFERAY_MNT_ORIG_TOMCAT}/lib/ext:${LIFERAY_CASSANDRA_HOME}/lib/ext
- ${LIFERAY_MNT_ORIG_TOMCAT}/conf:${LIFERAY_CASSANDRA_HOME}/conf
# - ${LIFERAY_MNT_ORIG_TOMCAT}/persistence:${LIFERAY_CASSANDRA_HOME}/persistence
2024-12-05 13:52:13 +01:00
- ${LIFERAY_MNT_TOMCAT}:${LIFERAY_CASSANDRA_HOME}
- ${LIFERAY_MNT_BUNDLE}/data:${LIFERAY_PORTAL_BUNDLE_PATH}/data
- ${LIFERAY_MNT_BUNDLE}/gCube:${LIFERAY_PORTAL_BUNDLE_PATH}/gCube
environment:
- JAVA_OPTS=-Duser.timezone=GMT
- JAVA_OPTS=-Djava.io.tmpdir=/var/tmp/tomcat-instance-9000-tmp
- CATALINA_HOME=${LIFERAY_CASSANDRA_HOME}
- CATALINA_BASE=${LIFERAY_CASSANDRA_HOME}
- CATALINA_TMPDIR=/var/tmp/tomcat-instance-9000-tmp
- CATALINA_PID=/home/life/pid.txt
- LIFERAY_TOMCAT_VERSION=${LIFERAY_TOMCAT_VERSION}
- LIFERAY_CASSANDRA_HOME=${LIFERAY_CASSANDRA_HOME}
- LIFERAY_DEBUG_PORT=${LIFERAY_DEBUG_PORT}
- LIFERAY_DEBUG_SUSPEND=${LIFERAY_DEBUG_SUSPEND}
- LIFERAY_JRUBY_VERSION=${LIFERAY_JRUBY_VERSION}
- LIFERAY_BUNDLER_VERSION=${LIFERAY_BUNDLER_VERSION}
# extra_hosts:
# - "liferay:127.0.0.1" # Map the liferay hostname to localhost
# - "liferay_docker:127.0.0.1" # Map the liferay hostname to localhost
# - "next.dev.d4science.org:127.0.0.1" # Map the next.dev.d4science.org hostname to localhost
# healthcheck:
# test: ["CMD-SHELL", "exec 3<>/dev/tcp/localhost/9090 && echo -e 'GET / HTTP/1.1\\r\\nHost: localhost\\r\\nConnection: close\\r\\n\\r\\n' >&3 && cat <&3 | grep -q '200 OK'"]
# interval: 30s
# timeout: 10s
# retries: 5
# start_period: 30s
2024-12-06 10:37:39 +01:00
# env_file: ".env"
2024-12-05 13:52:13 +01:00
depends_on:
keycloak:
condition: service_healthy
postgres:
condition: service_healthy
networks:
- app-network
networks:
app-network:
driver: bridge
cassandra-net:
driver: bridge