fix(HH-571): isolate WebChannel test service (#169)
Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
@@ -46,10 +46,17 @@ services:
|
||||
web-channel-test:
|
||||
image: nginx:alpine
|
||||
container_name: gochat-web-channel-test
|
||||
profiles: ["web-channel-test"]
|
||||
ports:
|
||||
- "8081:80"
|
||||
environment:
|
||||
NGINX_ENVSUBST_FILTER: ^WEB_CHANNEL_
|
||||
NGINX_ENVSUBST_OUTPUT_DIR: /usr/share/nginx/html
|
||||
WEB_CHANNEL_BASE_URL: ${WEB_CHANNEL_BASE_URL:-}
|
||||
WEB_CHANNEL_WEBSITE_TOKEN: ${WEB_CHANNEL_WEBSITE_TOKEN:-}
|
||||
volumes:
|
||||
- ./web-channel-test/index.html:/usr/share/nginx/html/index.html:ro
|
||||
- ./web-channel-test/index.html:/etc/nginx/templates/index.html.template:ro
|
||||
- ./web-channel-test/15-validate-env.envsh:/docker-entrypoint.d/15-validate-web-channel.envsh:ro
|
||||
|
||||
gochat:
|
||||
build:
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
: "${WEB_CHANNEL_BASE_URL:?set WEB_CHANNEL_BASE_URL}"
|
||||
: "${WEB_CHANNEL_WEBSITE_TOKEN:?set WEB_CHANNEL_WEBSITE_TOKEN}"
|
||||
@@ -10,14 +10,14 @@
|
||||
<script>
|
||||
window.chatwootSettings = { "position": "right", "type": "standard", "launcherTitle": "" };
|
||||
(function (d, t) {
|
||||
var BASE_URL = "https://gochat.yqbmb.com";
|
||||
var BASE_URL = "${WEB_CHANNEL_BASE_URL}";
|
||||
var g = d.createElement(t), s = d.getElementsByTagName(t)[0];
|
||||
g.src = BASE_URL + "/sdk/js/sdk.js";
|
||||
g.async = true;
|
||||
s.parentNode.insertBefore(g, s);
|
||||
g.onload = function () {
|
||||
window.chatwootSDK.run({
|
||||
websiteToken: "1e26e9f9866a6e7d988d85fa",
|
||||
websiteToken: "${WEB_CHANNEL_WEBSITE_TOKEN}",
|
||||
baseUrl: BASE_URL
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user