@cloud-cli/dx 2.2.1 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -90,13 +90,13 @@ export async function startContainer(options, { run }) {
90
90
  const { env, envKeys } = await getEnvVars(vars);
91
91
  const volumes = addExecFlag(container.volumes.split(','), 'v');
92
92
  const portBindings = addExecFlag([ports.join(':')], 'p');
93
- if (container.domain) {
94
- const [domain] = container.domain.split('/');
95
- await run('px.update', { domain, target: 'http://localhost:' + ports[0] });
96
- await run('dns.add', { domain });
97
- }
98
93
  const extraArgs = [];
99
94
  const config = await getConfig('dx');
95
+ if (container.domain) {
96
+ const [domain, path = ''] = container.domain.split("/");
97
+ await run("dns.add", { domain });
98
+ extraArgs.push("--label", "px:host=" + domain, "--label", "px:path=" + path);
99
+ }
100
100
  if (config.dns) {
101
101
  extraArgs.push('--dns=' + config.dns);
102
102
  }
@@ -124,6 +124,9 @@ export async function startContainer(options, { run }) {
124
124
  throw new Error(e);
125
125
  }
126
126
  logInfo('Started container ' + name);
127
+ if (container.domain) {
128
+ await run('px.reload');
129
+ }
127
130
  return true;
128
131
  }
129
132
  export async function stopContainer(options, { run }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloud-cli/dx",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "Docker container management",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",