Skip to content
Merged
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
7 changes: 5 additions & 2 deletions builders/_lagoon.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ module.exports = {
const hostnames = _.get(options, '_app.lagoon.containers', []);

// Normalize the dockerfile situation
// We need to do this again since this isnt technically an override
if (_.has(lagoon, 'build.context')) lagoon.build.context = path.join(options.root);
// Resolve build context relative to the project root so non-root contexts
// (eg context: frontend) work correctly instead of always forcing root
if (_.has(lagoon, 'build.context')) {
lagoon.build.context = path.resolve(options.root, lagoon.build.context);
}

// Handle portfoward in the usual way
if (options.portforward) {
Expand Down
2 changes: 1 addition & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ The services we currently support with links to their associated Lagoon docs is

Note that we are testing against the "Drupal" variants of the above but it's _possible_ the base services work as well.

*Please note: if using [uselagoon/solr-8-drupal](https://github.com/uselagoon/lagoon-images/blob/main/images/solr-drupal/8.Dockerfile) you will need to add the following command to your `Solr` service in your `.lando.yml` file. Alternate Solr images are supported and may require different commands, this is just one example.
*Please note: if using [uselagoon/solr-9-drupal](https://github.com/uselagoon/lagoon-images/blob/main/images/solr-drupal/9.Dockerfile) you will need to add the following command to your `Solr` service in your `.lando.yml` file. Alternate Solr images are supported and may require different commands, this is just one example.

```yaml
recipe: lagoon
Expand Down
8 changes: 4 additions & 4 deletions examples/all-services/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
lagoon.type: node
lando.type: node
ports:
- "3000"
- "3001:3000"
user: root
environment:
<< : *default-environment # loads the defined environment variables from the top
Expand All @@ -38,7 +38,7 @@ services:
lagoon.type: python
lando.type: python
ports:
- "8800"
- "8801:8800"
environment:
<< : *default-environment # loads the defined environment variables from the top
networks:
Expand All @@ -50,7 +50,7 @@ services:
lagoon.type: ruby
lando.type: ruby
ports:
- "3000"
- "3002:3000"
environment:
<< : *default-environment # loads the defined environment variables from the top
networks:
Expand All @@ -74,7 +74,7 @@ services:
lagoon.type: basic
lando.type: basic
ports:
- "3000"
- "3003:3000"
user: root
environment:
<< : *default-environment # loads the defined environment variables from the top
Expand Down
10 changes: 10 additions & 0 deletions examples/drupal9-base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ docker ps --filter label=com.docker.compose.project | grep Up | grep drupalbase_
docker ps --filter label=com.docker.compose.project | grep Up | grep drupalbase_php_1
docker ps --filter label=com.docker.compose.project | grep Up | grep drupalbase_cli_1

# Should have built nginx and php from the cli image via CLI_IMAGE build arg
cd drupal
lando ssh -s cli -c "test -f /app/web/index.php"
lando ssh -s nginx -c "test -f /app/web/index.php"
lando ssh -s php -c "test -f /app/web/index.php"

# Should not have additional_contexts in the generated compose files
cd drupal
cat ~/.lando/compose/drupalbase-* 2>/dev/null | grep "additional_contexts" && exit 1 || true

# Should ssh against the cli container by default
cd drupal
lando ssh -c "env | grep LAGOON=" | grep cli-drupal
Expand Down
6 changes: 3 additions & 3 deletions examples/proxy-tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
lagoon.type: node
lando.type: node
ports:
- "3000"
- "3011:3000"
user: root
environment:
<< : *default-environment # loads the defined environment variables from the top
Expand All @@ -38,7 +38,7 @@ services:
lagoon.type: python
lando.type: python
ports:
- "8800"
- "8811:8800"
environment:
<< : *default-environment # loads the defined environment variables from the top
networks:
Expand All @@ -50,7 +50,7 @@ services:
lagoon.type: ruby
lando.type: ruby
ports:
- "3000"
- "3012:3000"
environment:
<< : *default-environment # loads the defined environment variables from the top
networks:
Expand Down
21 changes: 15 additions & 6 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,20 @@ exports.loadConfigFiles = baseDir => {
*/
exports.parseServices = (services, recipeConfig) => _(services)
// Remove unneeded things from the docker config and determine the type of the service
.map((config, name) => _.merge({}, {
name,
type: getLabel(config.labels),
compose: _.omit(config, ['volumes', 'volumes_from', 'networks', 'user']),
config: recipeConfig,
}))
.map((config, name) => {
// Strip additional_contexts from build config since Lando splits services
// into separate compose files and service: refs cant resolve across them
if (_.has(config, 'build.additional_contexts')) {
config = _.cloneDeep(config);
delete config.build.additional_contexts;
}

return _.merge({}, {
name,
type: getLabel(config.labels),
compose: _.omit(config, ['volumes', 'volumes_from', 'networks', 'user']),
config: recipeConfig,
});
})
// Return
.value();
3 changes: 2 additions & 1 deletion lib/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const getBasicContainers = services => {
const basicContainers = _(services).filter(service => service.type === 'lagoon-basic').map('name').value();
let basicPort = '';
if (!_.isEmpty(basicContainers)) {
basicPort = services[_.first(basicContainers)].lagoon.ports[0];
const port = services[_.first(basicContainers)].lagoon.ports[0];
basicPort = port.includes(':') ? port.split(':')[1] : port;
}
return [basicContainers, basicPort];
};
Expand Down
20 changes: 15 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading