Commit 23ad7598 authored by Benji Fisher's avatar Benji Fisher

Merge branch '4-configure-nginx-or-apache-to-serve-the-gatsby-site' into 'master'

Resolve "Configure nginx or apache to serve the Gatsby site"

Closes #4

See merge request !8
parents c20b0fdd f3d9c7d0
......@@ -12,13 +12,16 @@ proxy:
- gatsby.lgd.lndo.site:8000
nginx:
- drupal.lgd.lndo.site
gatsbydrupal:
- gatsbydrupal.lgd.lndo.site
services:
appserver:
install_dependencies_as_me:
- cd drupal && composer install
run:
- cd drupal/web && drush --yes site:install demo_umami --db-url=mysql://drupal8:drupal8@database:3306/drupal8 --account-pass=admin --site-name='Drupal-Gatsby' && drush --yes pm:enable jsonapi
- cd drupal/web && drush --yes site:install demo_umami --db-url=mysql://drupal8:drupal8@database:3306/drupal8 --account-pass=admin --site-name='Drupal-Gatsby'
- cd drupal/web && drush --yes pm:enable jsonapi
nodejs:
type: node:8.9
ssl: true
......@@ -30,6 +33,14 @@ services:
yarn: "1.13.0"
run:
- cd gatsby && yarn install
gatsbydrupal:
type: nginx
ssl: true
webroot: gatsby/public
events:
post-start:
- nodejs: cd gatsby && gatsby build
tooling:
npm:
......
......@@ -79,21 +79,26 @@ It will
- Install the [JSON:API](https://www.drupal.org/project/jsonapi) Drupal
module.
- Install a Gatsby project pulling data from the Drupal site.
- Build the Gatsby project.
- Tell you which URLs are being served.
In particular, you should be able to visit these pages in a web browser:
In particular, you should be able to visit these pages in a web browser.
- Your Drupal site: https://drupal.lgd.lndo.site/
- Your JSON API endpoint: https://drupal.lgd.lndo.site/jsonapi
- Your Gatsby site: https://gatsbydrupal.lgd.lndo.site/
- Your Gatsby pages imported from Drupal: https://gatsbydrupal.lgd.lndo.site/blog/
For now, the Gatsby pages will only be available once you have started the
Gatsby server. (See below.)
Your browser will give you a warning about the site's certificate.
If that bothers you, then you can use `http` instead of `https`.
The second command gives more information about the configured containers.
For sample command-line output from these two commands, see
[Start Lando](docs/lando-start-log.md).
## Other ways to explore
### Build and run your Gatsby project
There are two ways you can use `nodejs` to serve your site:
......@@ -131,8 +136,6 @@ Use CTRL-C in your terminal window to stop the node server.
For sample command-line output, see
[Starting Gatsby](docs/gatsby-log.md).
## Other ways to explore
### Create a Gatsby project
If you want to run additional Gatsby sites, then run the following commands
......
This diff is collapsed.
......@@ -9,8 +9,7 @@ module.exports = {
{
resolve: 'gatsby-source-drupal',
options: {
// Within the Lando network, the Drupal web server is nginx.
baseUrl: 'http://nginx/',
baseUrl: 'http://drupal.lgd.lndo.site/',
// Using the JSON:API module, the base URL for REST queries is
// /jsonapi.
apiBase: 'jsonapi',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment