Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"dev": "vite --port=3000 --host=0.0.0.0",
"build": "vite build",
"docker:build": "docker compose build tigrcorn-com",
"check": "npm run lint",
"preview": "vite preview",
"proxy:target-check": "node scripts/validate-proxy-target.mjs",
Expand Down
6 changes: 3 additions & 3 deletions scripts/validate-proxy-target.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ if (!composeLines.some((line) => /^\s*expose:\s*(?:#.*)?$/.test(line)) || !compo
throw new Error("docker-compose.yaml must expose port 80 to the Docker network");
}

if (!/^\s{4}networks:\s*(?:#.*)?$/m.test(compose) || !/^\s{6}dockerwp:\s*(?:#.*)?$/m.test(compose) || !/^\s{4}name:\s*dockerwp\s*(?:#.*)?$/m.test(compose) || !/^\s{4}external:\s*true\s*(?:#.*)?$/m.test(compose)) {
throw new Error("docker-compose.yaml must attach the site service to the external dockerwp network");
if (!/^\s{4}networks:\s*(?:#.*)?$/m.test(compose) || !/^\s{6}portwyrm-edge:\s*(?:#.*)?$/m.test(compose) || !/^\s{4}name:\s*portwyrm-edge\s*(?:#.*)?$/m.test(compose) || !/^\s{4}external:\s*true\s*(?:#.*)?$/m.test(compose)) {
throw new Error("docker-compose.yaml must attach the site service to the external portwyrm-edge network");
}

const containerMatch = compose.match(/^\s*container_name:\s*([^\r\n#]+)/m);
Expand All @@ -37,4 +37,4 @@ for (const forwardHost of forwardMatches) {
}
}

console.log(`proxy target ok: ${containerName} on dockerwp with exposed port 80`);
console.log(`proxy target ok: ${containerName} on portwyrm-edge with exposed port 80`);
Loading