diff --git a/apps/agora/docker-compose.yml b/apps/agora/docker-compose.yml index 7336cfb..568cee4 100644 --- a/apps/agora/docker-compose.yml +++ b/apps/agora/docker-compose.yml @@ -13,6 +13,10 @@ services: environment: APP_PASSWORD: "$APP_PASSWORD" entrypoint: /data/entrypoint.sh + networks: + default: + ipv4_address: $APP_AGORA_FILEBROWSER_IP + agora: image: ghcr.io/agora-org/agora:sha-48d3205@sha256:35eda120a8d868c7fa3b9cbdcad7cc2245b9fe7e0c5356c8091bb0bf9a65222d @@ -32,14 +36,21 @@ services: # App specific environment variables FILES_DIR: "/files" AGORA_PORT: 8080 + networks: + default: + ipv4_address: $APP_AGORA_SERVER_IP nginx: image: nginx:1.19-alpine@sha256:c2ce58e024275728b00a554ac25628af25c54782865b3487b11c21cafb7fabda init: true restart: on-failure volumes: - - ${APP_DATA_DIR}/nginx/nginx.conf:/etc/nginx/nginx.conf + - ${APP_DATA_DIR}/nginx/nginx.conf.template:/etc/nginx/templates/nginx.conf.template - ${APP_DATA_DIR}/data/www:/usr/share/nginx/html + environment: + NGINX_ENVSUBST_OUTPUT_DIR: /etc/nginx/ + APP_AGORA_SERVER_IP: $APP_AGORA_SERVER_IP + APP_AGORA_FILEBROWSER_IP: $APP_AGORA_FILEBROWSER_IP ports: - "$APP_AGORA_PORT:80" depends_on: diff --git a/apps/agora/nginx/nginx.conf b/apps/agora/nginx/nginx.conf.template similarity index 68% rename from apps/agora/nginx/nginx.conf rename to apps/agora/nginx/nginx.conf.template index 8f6290f..4cfd1ae 100644 --- a/apps/agora/nginx/nginx.conf +++ b/apps/agora/nginx/nginx.conf.template @@ -8,7 +8,7 @@ server { server_name _; location / { - proxy_pass http://agora:8080; + proxy_pass http://${APP_AGORA_SERVER_IP}:8080; } location /admin { @@ -18,7 +18,7 @@ server { location /admin/files { client_max_body_size 0; - proxy_pass http://filebrowser:8080; + proxy_pass http://${APP_AGORA_FILEBROWSER_IP}:8080; } } diff --git a/scripts/configure b/scripts/configure index 12730d8..5e561e5 100755 --- a/scripts/configure +++ b/scripts/configure @@ -258,7 +258,9 @@ APP_BLESKOMAT_SERVER_IP="10.21.21.85" APP_BLESKOMAT_SERVER_DB_IP="10.21.21.86" APP_AGORA_IP="10.21.21.87" APP_AGORA_PORT="12080" -APP_SPARKKIOSK_IP="10.21.21.88" +APP_AGORA_SERVER_IP="10.21.21.88" +APP_AGORA_FILEBROWSER_IP="10.21.21.89" +APP_SPARKKIOSK_IP="10.21.21.90" APP_SPARKKIOSK_PORT="21214" # Generate RPC credentials @@ -518,6 +520,8 @@ for template in "${NGINX_CONF_FILE}" "${BITCOIN_CONF_FILE}" "${LND_CONF_FILE}" " sed -i "s//${APP_BLESKOMAT_SERVER_DB_IP}/g" "${template}" sed -i "s//${APP_AGORA_IP}/g" "${template}" sed -i "s//${APP_AGORA_PORT}/g" "${template}" + sed -i "s//${APP_AGORA_SERVER_IP}/g" "${template}" + sed -i "s//${APP_AGORA_FILEBROWSER_IP}/g" "${template}" sed -i "s//${APP_SPARKKIOSK_IP}/g" "${template}" sed -i "s//${APP_SPARKKIOSK_PORT}/g" "${template}" done diff --git a/templates/.env-sample b/templates/.env-sample index a00a67d..0aadf3e 100644 --- a/templates/.env-sample +++ b/templates/.env-sample @@ -156,5 +156,7 @@ APP_BLESKOMAT_SERVER_IP= APP_BLESKOMAT_SERVER_DB_IP= APP_AGORA_IP= APP_AGORA_PORT= +APP_AGORA_SERVER_IP= +APP_AGORA_FILEBROWSER_IP= APP_SPARKKIOSK_IP= APP_SPARKKIOSK_PORT= \ No newline at end of file