Roots Discourse

Bedrock installation on Lando

I am trying to get Bedrock installed. I am running Linux Mint, with Lando installed.
I am putting projects in ~/sites

A separate (non-Bedrock) project that simply installs WordPress in ~/sites/wordpress works fine, shows in the url given; Lando is working.
( ~/sites/wordpress, $ lando rebuild gives APPSERVER_NGINX URLS lc.lndo.site )


cd ~/sites/themedev/
lando rebuild 

Should I have to do wp core install, or should Bedrock installation do it?
cd ~/sites/themedev/bedrock; lando wp core install --url=https://bedrock.lndo.site --title='Bedrock Test' --admin_user=YOURADMIN --admin_email=you@youremail.com

When I run lando rebuild and lando wp core install, then this works:
cd ~/sites/themedev/bedrock; lando wp user list

The Bedrock project, only displays “File not found.” when browse to the given URL.
pma.lc.lndo.site works bringing up phpMyAdmin
themedev.lndo.site/wp/ gives “File not found.”
themedev.lndo.site/ gives “File not found.”

What is the exact URL to browse to for viewing this site?

What are the exact instructions for installing Bedrock and Sage? Start with “cd ~/some/folder/”

Is /app a link to ~/sites/themedev ?

What is wrong in ~/sites/themedev/.lando.yml (see below)?

Is there a command to give other than lando rebuild ?
Do I need to call composer for Bedrock, or does the Bedrock setup do that directly?

----- SSL certificates
pma.themedev.lndo.site
gives warning "Websites prove their identity via certificates. Firefox does not trust this site because it uses a certificate that is not valid for pma.themedev.lndo.site. The certificate is only valid for the following names: *.lndo.site, traefix, proxy, …internal, localhost, ..lndo.site, ...lndo.site "

What do I do to fix this? (Doesn’t ..lndo.site cover this site?)

----- I have # ~/sites/themedev/.env

DB_NAME=wordpress
DB_USER=wordpress
DB_PASSWORD=wordpress
DB_HOST=database

WP_ENV=development
WP_HOME=https://themedev.lndo.site
WP_SITEURL=${WP_HOME}/wp

----- I have ~/sites/themedev/.lando.yml

name: themedev
recipe: wordpress
config:
    php: '7.2'
    via: nginx
    webroot: web
    database: mariadb
    xdebug: true
    ssl: true

proxy:
# 'ngninx' here gives error, 'web' also gives error.
# 'appserver' is listed as a service, and is mentioned with xdebug
    appserver:
        - bedrock.test
    theme:
        - localhost:3000
    mailhog:
        - mail.themedev.lndo.site
    pma:
        - pma.themedev.lndo.site

services:
    appserver:
        build: # from discourse.roots.io/t/lando-sage-localhost-with-https-and-hostname/17562/2
            - printf "\n\nInstall app dependencies\n"
            - cd /app && wp package install --quiet git@github.com:alwaysblank/blade-generate.git
            - cd /app &&  wp package install --quiet wp-cli/find-command
        run:
            - printf "\n\nInstall composer dependencies\n"
            - cd /app/wp-content/themes/sage/ && composer install
            # ~/sites/themedev/wp-content/themes/sage/composer.json
            - echo "Include /app/dev_assets/scripts/hosts" >> ~/.ssh/config
        # webroot: /app/bedrock/web ?
        xdebug: true
        composer:
            phpunit/phpunit: "*"
    theme:
        type: node:10  # docs.lando.dev/config/node.html#configuration
# delete the services line, from discourse.roots.io/t/issue-starting-lando-with-bedrock/14871     services:
        ports:
            # 3000 gives error "Bind for 0.0.0.0:3000 failed: port is already allocated"
            - '3010:3010'
        run:
            - printf "\n\nInstall yarn dependencies\n"
            - yarn config set disable-self-update-check true
            - cd /app/wp-content/themes/sage/ && yarn install
    mailhog:
        type: mailhog # Spin up a mailhog container called "mailhog".
        hogfrom: # Hog from appserver or nginx as appropriate.
            - appserver
    pma:
        type: phpmyadmin # Spin up a phpmyadmin container called "pma".
        hosts:
            - database

tooling:
    phpunit:
        service: appserver
        description: "Run PHP Unit tests: lando phpunit"
    yarn:
        service: theme
    gulp:
        service: node
    bower:
        service: node
    npm:
        service: node
    node:
        service: node
    xdebug-on:
        service: appserver
        description: Enable xdebug for nginx.
        cmd: docker-php-ext-enable xdebug && pkill -o -USR2 php-fpm
        user: root
    xdebug-off:
        service: appserver
        description: Disable xdebug for nginx.
        cmd: >-
          rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && pkill -o -USR2
          php-fpm
    user: root

=====

The guide on the roots site was written for lando 2.x, (or 3.0 alpha, I don’t remember) lando is now in version 3-rc so some changes have been made to the naming. In your example: appserver should be appserver_nginx.
You can read more on this here: https://docs.lando.dev/guides/updating-to-rc2.html#internal-service-name-changes

This is the .lndo.yml file I use for bedrock:

name: example
recipe: wordpress
proxy:                
  appserver_nginx:              # Optional: if you exclude this, Lando will serve it as bedrock.lndo.site
    - example.lndo.site
  # theme:              # Optional: add this if you include the Sage specific config down below
  #   - localhost:3000
config:
  php: '7.3'
  via: nginx
  webroot: web
  database: mariadb
  xdebug: true

# Add the following if you plan to use Sage as a starter theme
# services:
#   theme:
#     type: node
#     services:
#       ports:
#         - 3000:3000
# tooling:
#   yarn:
#     service: theme

And the .env:

DB_NAME=wordpress
DB_USER=wordpress
DB_PASSWORD=wordpress
DB_HOST=database

WP_ENV=development
WP_HOME=https://example.lndo.site
WP_SITEURL=${WP_HOME}/wp

warn: bedrock is not a supported recipe type
Should that be “recipe: wordpress” or did you make a recipe?

Whoops, you’re right. Fixed in my original post.

Changed in my ~/sites/themedev/.env and then copy to themedev/bedrock/.env (seems to be needed there, after creating the bedrock folder).

WP_HOME=https://themedev.lndo.site
# docs.lando.dev/guides/updating-to-rc2.html#internal-service-name-changes
#       says obsolete syntax: WP_SITEURL=${WP_HOME}/wp
WP_SITEURL=https://themedev.lndo.site/wp

In my ~/sites/themedev/.lando.yml, in the config: section,

# docs.lando.dev/guides/updating-to-rc2.html#internal-service-name-changes
# says "You now have to explicitly set the top level env_file if you want to load a env file.""
env_file:
    - /app/.env