Skip to content
This repository was archived by the owner on Nov 23, 2022. It is now read-only.

Commit 81d9952

Browse files
committed
Merge all networks from compose file during deployment
Cherry-picked from #16
1 parent 9f1a76d commit 81d9952

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/docker/templates/compose.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ const updateCompose = ({username, baseName, serverConfig, composePath, util, res
5050
Object.keys(compose.services).forEach(svcKey => {
5151
const name = `${baseName}-${svcKey}-${uid.split('-').shift()}`;
5252
const backend = `${baseName}-${svcKey}`;
53+
const networks = Array.from(new Set([network, ...(compose.services[svcKey].networks || ['default'])]));
5354
// update basic settings
5455
const ext = {
5556
container_name: name,
5657
restart: 'on-failure:2',
57-
networks: [network, 'default'],
5858
};
59-
compose.services[svcKey] = Object.assign({}, ext, compose.services[svcKey]);
59+
compose.services[svcKey] = Object.assign({}, ext, compose.services[svcKey], {networks});
6060

6161
// update labels if needed
6262
const extLabels = {

0 commit comments

Comments
 (0)