Browse Source

Use static container IPs in agora app

0.4.17
Luke Childs 3 years ago
parent
commit
7940665000
  1. 13
      apps/agora/docker-compose.yml
  2. 4
      apps/agora/nginx/nginx.conf.template
  3. 6
      scripts/configure
  4. 2
      templates/.env-sample

13
apps/agora/docker-compose.yml

@ -13,6 +13,10 @@ services:
environment: environment:
APP_PASSWORD: "$APP_PASSWORD" APP_PASSWORD: "$APP_PASSWORD"
entrypoint: /data/entrypoint.sh entrypoint: /data/entrypoint.sh
networks:
default:
ipv4_address: $APP_AGORA_FILEBROWSER_IP
agora: agora:
image: ghcr.io/agora-org/agora:sha-48d3205@sha256:35eda120a8d868c7fa3b9cbdcad7cc2245b9fe7e0c5356c8091bb0bf9a65222d image: ghcr.io/agora-org/agora:sha-48d3205@sha256:35eda120a8d868c7fa3b9cbdcad7cc2245b9fe7e0c5356c8091bb0bf9a65222d
@ -32,14 +36,21 @@ services:
# App specific environment variables # App specific environment variables
FILES_DIR: "/files" FILES_DIR: "/files"
AGORA_PORT: 8080 AGORA_PORT: 8080
networks:
default:
ipv4_address: $APP_AGORA_SERVER_IP
nginx: nginx:
image: nginx:1.19-alpine@sha256:c2ce58e024275728b00a554ac25628af25c54782865b3487b11c21cafb7fabda image: nginx:1.19-alpine@sha256:c2ce58e024275728b00a554ac25628af25c54782865b3487b11c21cafb7fabda
init: true init: true
restart: on-failure restart: on-failure
volumes: 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 - ${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: ports:
- "$APP_AGORA_PORT:80" - "$APP_AGORA_PORT:80"
depends_on: depends_on:

4
apps/agora/nginx/nginx.conf → apps/agora/nginx/nginx.conf.template

@ -8,7 +8,7 @@ server {
server_name _; server_name _;
location / { location / {
proxy_pass http://agora:8080; proxy_pass http://${APP_AGORA_SERVER_IP}:8080;
} }
location /admin { location /admin {
@ -18,7 +18,7 @@ server {
location /admin/files { location /admin/files {
client_max_body_size 0; client_max_body_size 0;
proxy_pass http://filebrowser:8080; proxy_pass http://${APP_AGORA_FILEBROWSER_IP}:8080;
} }
} }

6
scripts/configure

@ -258,7 +258,9 @@ APP_BLESKOMAT_SERVER_IP="10.21.21.85"
APP_BLESKOMAT_SERVER_DB_IP="10.21.21.86" APP_BLESKOMAT_SERVER_DB_IP="10.21.21.86"
APP_AGORA_IP="10.21.21.87" APP_AGORA_IP="10.21.21.87"
APP_AGORA_PORT="12080" 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" APP_SPARKKIOSK_PORT="21214"
# Generate RPC credentials # 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>/${APP_BLESKOMAT_SERVER_DB_IP}/g" "${template}" sed -i "s/<app-bleskomat-server-db-ip>/${APP_BLESKOMAT_SERVER_DB_IP}/g" "${template}"
sed -i "s/<app-agora-ip>/${APP_AGORA_IP}/g" "${template}" sed -i "s/<app-agora-ip>/${APP_AGORA_IP}/g" "${template}"
sed -i "s/<app-agora-port>/${APP_AGORA_PORT}/g" "${template}" sed -i "s/<app-agora-port>/${APP_AGORA_PORT}/g" "${template}"
sed -i "s/<app-agora-server-ip>/${APP_AGORA_SERVER_IP}/g" "${template}"
sed -i "s/<app-agora-filebrowser-ip>/${APP_AGORA_FILEBROWSER_IP}/g" "${template}"
sed -i "s/<app-sparkkiosk-ip>/${APP_SPARKKIOSK_IP}/g" "${template}" sed -i "s/<app-sparkkiosk-ip>/${APP_SPARKKIOSK_IP}/g" "${template}"
sed -i "s/<app-sparkkiosk-port>/${APP_SPARKKIOSK_PORT}/g" "${template}" sed -i "s/<app-sparkkiosk-port>/${APP_SPARKKIOSK_PORT}/g" "${template}"
done done

2
templates/.env-sample

@ -156,5 +156,7 @@ APP_BLESKOMAT_SERVER_IP=<app-bleskomat-server-ip>
APP_BLESKOMAT_SERVER_DB_IP=<app-bleskomat-server-db-ip> APP_BLESKOMAT_SERVER_DB_IP=<app-bleskomat-server-db-ip>
APP_AGORA_IP=<app-agora-ip> APP_AGORA_IP=<app-agora-ip>
APP_AGORA_PORT=<app-agora-port> APP_AGORA_PORT=<app-agora-port>
APP_AGORA_SERVER_IP=<app-agora-server-ip>
APP_AGORA_FILEBROWSER_IP=<app-agora-filebrowser-ip>
APP_SPARKKIOSK_IP=<app-sparkkiosk-ip> APP_SPARKKIOSK_IP=<app-sparkkiosk-ip>
APP_SPARKKIOSK_PORT=<app-sparkkiosk-port> APP_SPARKKIOSK_PORT=<app-sparkkiosk-port>
Loading…
Cancel
Save