# please also retrieve the .env file # https://github.com/convertigo/docker/raw/refs/heads/master/compose/mbaas/.env name: convertigo services: convertigo_0: image: "${CONVERTIGO_IMAGE}" restart: ${RESTART_POLICY} deploy: replicas: 1 ports: - "28080:28080" volumes: - ./workspace:/workspace environment: - JAVA_OPTS= -Dconvertigo.engine.log4j.appender.CemsAppender.File=/workspace/logs/0/engine.log -Dconvertigo.engine.billing.enabled=true -Dconvertigo.engine.billing.persistence.jdbc.username=${CONVERTIGO_BILLING_USER} -Dconvertigo.engine.billing.persistence.jdbc.password=${CONVERTIGO_BILLING_PASSWORD} -Dconvertigo.engine.billing.persistence.jdbc.url=jdbc:mysql://mysql:3306/${CONVERTIGO_BILLING_DB}?useSSL=false\&allowPublicKeyRetrieval=true -Dconvertigo.engine.fullsync.couch.username=${CONVERTIGO_FULLSYNC_USER} -Dconvertigo.engine.fullsync.couch.password=${CONVERTIGO_FULLSYNC_PASSWORD} - BASEROW_PUBLIC_URL=${BASEROW_PUBLIC_URL} command: > /bin/sh -c "chown convertigo:convertigo /workspace /docker-entrypoint.sh convertigo" convertigo_1: image: "${CONVERTIGO_IMAGE}" restart: ${RESTART_POLICY} deploy: replicas: ${CONVERTIGO_MULTI_ENABLE} ports: - "28081:28080" volumes: - ./workspace:/workspace depends_on: - convertigo_0 environment: - JAVA_OPTS= -Dconvertigo.engine.log4j.appender.CemsAppender.File=/workspace/logs/1/engine.log -Dconvertigo.engine.billing.enabled=true -Dconvertigo.engine.billing.persistence.jdbc.username=${CONVERTIGO_BILLING_USER} -Dconvertigo.engine.billing.persistence.jdbc.password=${CONVERTIGO_BILLING_PASSWORD} -Dconvertigo.engine.billing.persistence.jdbc.url=jdbc:mysql://mysql:3306/{CONVERTIGO_BILLING_DB}?useSSL=false\&allowPublicKeyRetrieval=true -Dconvertigo.engine.fullsync.couch.username=${CONVERTIGO_FULLSYNC_USER} -Dconvertigo.engine.fullsync.couch.password=${CONVERTIGO_FULLSYNC_PASSWORD} - BASEROW_PUBLIC_URL=${BASEROW_PUBLIC_URL} couchdb: image: "${COUCHDB_IMAGE}" restart: ${RESTART_POLICY} deploy: replicas: ${COUCHDB_ENABLE} ports: - "28090:5984" environment: - COUCHDB_USER=${CONVERTIGO_FULLSYNC_USER} - COUCHDB_PASSWORD=${CONVERTIGO_FULLSYNC_PASSWORD} volumes: - ./fullsync:/opt/couchdb/data command: > /bin/sh -c "echo '[couchdb] single_node=true' > /opt/couchdb/etc/local.d/setup.ini /docker-entrypoint.sh couchdb" mysql: image: "${MYSQL_IMAGE}" restart: ${RESTART_POLICY} deploy: replicas: ${MYSQL_ENABLE} ports: - "28092:3306" volumes: - ./analytics:/var/lib/mysql environment: - MYSQL_RANDOM_ROOT_PASSWORD=yes - MYSQL_DATABASE=${CONVERTIGO_BILLING_DB} - MYSQL_USER=${CONVERTIGO_BILLING_USER} - MYSQL_PASSWORD=${CONVERTIGO_BILLING_PASSWORD} httpd: image: "${HTTPD_IMAGE}" restart: ${RESTART_POLICY} deploy: replicas: ${HTTPD_ENABLE} ports: - "${HTTPD_HTTP_PORT}:80" - "${HTTPD_HTTPS_PORT}:443" volumes: - "./certs:/usr/local/apache2/conf/certs:ro" depends_on: - convertigo_0 command: > /bin/sh -c " if ! grep -q 'fullchain.pem' /usr/local/apache2/conf/httpd.conf; then echo ' LoadModule rewrite_module modules/mod_rewrite.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so LoadModule ssl_module modules/mod_ssl.so LoadModule slotmem_shm_module modules/mod_slotmem_shm.so LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so Listen 443 ServerName ${PUBLIC_HOSTNAME} SSLEngine on SSLCertificateFile /usr/local/apache2/conf/certs/fullchain.pem SSLCertificateKeyFile /usr/local/apache2/conf/certs/privkey.pem RewriteEngine On RewriteRule ^/?$ /convertigo/ [R=301,L] RewriteRule ^/convertigo$ /convertigo/ [R=301,L] BalancerMember http://convertigo_0:28080 route=0 #BalancerMember http://convertigo_1:28080 route=1 ProxySet stickysession=ROUTEID ProxyPass \"/convertigo\" \"balancer://convertigo_cluster\" ProxyPassReverse \"/convertigo\" \"balancer://convertigo_cluster\" ProxyPass \"/c8o\" \"balancer://convertigo_cluster/projects/BaserowIntegration/c8o\" ProxyPassReverse \"/c8o\" \"balancer://convertigo_cluster/projects/BaserowIntegration/c8o\" ProxyPass \"/ws/\" \"ws://baserow/ws/\" ProxyPass \"/\" \"http://baserow/\" ProxyPassReverse \"/\" \"http://baserow/\" Header add Set-Cookie \"ROUTEID=.%{BALANCER_WORKER_ROUTE}e; Path=/; HttpOnly\" env=BALANCER_ROUTE_CHANGED ProxyPreserveHost On ServerName ${PUBLIC_HOSTNAME} #Redirect permanent / https://${PUBLIC_HOSTNAME}/ RewriteEngine On RewriteRule ^/?$ /convertigo/ [R=301,L] RewriteRule ^/convertigo$ /convertigo/ [R=301,L] BalancerMember http://convertigo_0:28080/convertigo route=0 #BalancerMember http://convertigo_1:28080/convertigo route=1 ProxySet stickysession=ROUTEID ProxyPass \"/convertigo\" \"balancer://convertigo_cluster\" ProxyPassReverse \"/convertigo\" \"balancer://convertigo_cluster\" ProxyPass \"/c8o\" \"balancer://convertigo_cluster/projects/BaserowIntegration/c8o\" ProxyPassReverse \"/c8o\" \"balancer://convertigo_cluster/projects/BaserowIntegration/c8o\" ProxyPass \"/ws/\" \"ws://baserow/ws/\" ProxyPass \"/\" \"http://baserow/\" ProxyPassReverse \"/\" \"http://baserow/\" Header add Set-Cookie \"ROUTEID=.%{BALANCER_WORKER_ROUTE}e; Path=/; HttpOnly\" env=BALANCER_ROUTE_CHANGED ProxyPreserveHost On ' >> /usr/local/apache2/conf/httpd.conf fi httpd-foreground" baserow: image: "${BASEROW_IMAGE}" restart: ${RESTART_POLICY} deploy: replicas: ${BASEROW_ENABLE} ports: - "28094:80" volumes: - "./baserow:/baserow/data" entrypoint: > /bin/sh -c " sed -i -e s,127.0.0.1,0.0.0.0, /baserow/supervisor/default_baserow_env.sh /baserow.sh start" environment: - BASEROW_PUBLIC_URL=${BASEROW_PUBLIC_URL} - BASEROW_EXTRA_ALLOWED_HOSTS=${BASEROW_EXTRA_ALLOWED_HOSTS}